Return-Path: X-Original-To: apmail-lucene-java-user-archive@www.apache.org Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 49B3017FE6 for ; Sat, 19 Sep 2015 01:17:28 +0000 (UTC) Received: (qmail 60526 invoked by uid 500); 19 Sep 2015 01:17:21 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 60467 invoked by uid 500); 19 Sep 2015 01:17:21 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 60445 invoked by uid 99); 19 Sep 2015 01:17:21 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Sep 2015 01:17:21 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id A46CA1A2564; Sat, 19 Sep 2015 01:17:20 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.901 X-Spam-Level: *** X-Spam-Status: No, score=3.901 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, KAM_LIVE=1, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, WEIRD_PORT=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id eaIBP_Y6BgAx; Sat, 19 Sep 2015 01:17:13 +0000 (UTC) Received: from mail-vk0-f53.google.com (mail-vk0-f53.google.com [209.85.213.53]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 3162F2074F; Sat, 19 Sep 2015 01:17:13 +0000 (UTC) Received: by vkao3 with SMTP id o3so39367649vka.2; Fri, 18 Sep 2015 18:17:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-type; bh=PRSTfAYGqbi08E4yzSxmEhqjFrkZPO2cxW3oCx1yk4Q=; b=nQO5mpGr7Km8TY6ixOr4/Z2PzeDcsCzMlLXlUSqKo2ghG5GUgUImhc7aKaPx89mFBI bqEgDUOLVI6S/3gARpWzvWU86C0Ulc8TjCCz3okK1NJVoCKsE7igTjLudUix/F2OPjvK A3pfW4Y0DWECH8GwBPaiAY/rv9vSHbBjkKXb0rtgYAqXKCRC0RTF8B+YUqx3AF2gqogL 3kD4aZ92HQpPbB0L1Ht2Gw0ydfKdW3wfAkHeapbrwpszEyTQoZGvJYswY2HVYIiyR67P 9rFp0sQXZ3OEfPkIn2SGbvdNf8iiZde0826sgfUXycy8vfRFAt13gZVuz+eC+8oa/xiQ Oy/g== X-Received: by 10.31.153.212 with SMTP id b203mr4691595vke.19.1442625432084; Fri, 18 Sep 2015 18:17:12 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ajinkya Kale Date: Sat, 19 Sep 2015 01:17:01 +0000 Message-ID: Subject: Re: Question related to reranking and RankQuery To: solr-user@lucene.apache.org Cc: "java-user@lucene.apache.org" Content-Type: multipart/alternative; boundary=001a1141cd726c680805200f68fe --001a1141cd726c680805200f68fe Content-Type: text/plain; charset=UTF-8 Is there a way to do something like q=hello+world&rq={!rerank reRankQuery=$rqq reRankDocs=100}&rqq=sort={!func}myFunc() desc ? or even as simple as 1. http://localhost:8983/solr/0/select?q=edgengram:abc&wt=json&indent=true&debugQuery=true&rq={!rerank reRankQuery=$rqq reRankDocs=20}&rqq=sort=some_field desc I am not able to get the last part right. I dont think my rqq is right. --aj On Fri, Sep 18, 2015 at 12:00 PM Joel Bernstein wrote: > The syntax would be something like this: > > q=hello+world&rq={!rerank reRankQuery=$rqq > reRankDocs=100}&rqq={!func}myFunc() > > I'm not sure if there is a test case demonstrating this but it should work. > > Joel Bernstein > http://joelsolr.blogspot.com/ > > On Fri, Sep 18, 2015 at 2:42 PM, Ajinkya Kale > wrote: > > > Is there a way I can issue a regular query with q and then apply > > functionQuery only on the top n documents of the result from q ? > > Applying functionQuery on all documents will be very expensive in my > case. > > I am not able to find a way to "rerank" only top N documents using > Function > > Query. > > > > --aj > > > > On Fri, Sep 18, 2015 at 5:04 AM Joel Bernstein > wrote: > > > > > The ReRankQuery re-ranks the Top N documents of the main query based > on a > > > query. Rather then the CustomScoreQuery you may want to look at > ReRanking > > > by a Function Query using the FunctionQParserPlugin. This would allow > you > > > to directly control the ReRankScore for the top N documents. > > > > > > Writing your own RankQuery should be the last resort if you can't make > a > > > Function Query do what you need to do. > > > > > > > > > > > > Joel Bernstein > > > http://joelsolr.blogspot.com/ > > > > > > On Thu, Sep 17, 2015 at 10:44 PM, Ajinkya Kale > > > wrote: > > > > > > > Hi all, > > > > > > > > I am new to Solr. I have a QParser plugin which uses an > implementation > > > > of CustomScoreQuery to provide custom score for each document. > > > > Is there a way I can use the same plugin to provide score for top N > > > > documents after an initial query/sort ? > > > > I looked at the ReRankQParserPlugin but it looks lot more involved to > > > write > > > > a custom RankQuery implementation. So I was thinking if I can reuse > my > > > > existing CustomScoreQuery implementation to provide score for top N > > > > documents to rerank. > > > > > > > > On a side note, is there a place where the ReRankQParserPlugin is > > > explained > > > > in detail ? > > > > > > > > --aj > > > > > > > > > > --001a1141cd726c680805200f68fe--