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 <kaleajin...@gmail.com> 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 <joels...@gmail.com> 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 <kaleajin...@gmail.com> > > 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 > > > > > >