Hi Joel, Thanks for your reply, Yes, I considered the Collapse and Expand [1] , the problem is that I'll deploy it on a multishard instance and I want to retrieve the top N groups. I thing that collapse and expand could have two downsides:
i) it won't guarantee the retrieval of N groups, I could mitigate retrieving a larger number of documents, but I would prefer to avoid. ii) It won't guarantee to have the best document per group: a shard A could have high scoring documents in a group G1, and then have a top scoring document D for the group G2, but since each shard returns only its top documents, potentially I could lose D as head of the group G2, if another shard returns documents in G2 with a lower score. Cheers, Diego [1] https://cwiki.apache.org/confluence/display/solr/Collapse+and+Expand+Results On Thu, Jul 16, 2015 at 2:01 AM, Joel Bernstein <joels...@gmail.com> wrote: > As you've seen RankQueries won't currently have any effect on Grouping > queries. > > A RankQuery can be combined with Collapse and Expand though. You may want > to review Collapse and Expand and see if it meets your use case. > > Joel Bernstein > http://joelsolr.blogspot.com/ > > On Wed, Jul 15, 2015 at 2:36 PM, Diego Ceccarelli < > diego.ceccare...@gmail.com> wrote: > > > Hi Everyone, > > > > I need to use a RankQuery within a grouping [1]. > > I did some experiments with RerankQuery [2] and solr 4.10.2 and it seems > > that > > if you group on a field, the reranking query is completely ignored > > (on the cloud, and on a single instance). > > I would expect to see the results in each group reranked using the > > RerankQuery. > > > > I had a look at the grouping code and documentation and, > > if I correctly understood, the grouping works in two steps: > > > > 1) first the top groups are retrieved > > 2) top documents for each group in the top groups are retrieved. > > > > I thought that the collector generated by a RankQuery could be injected > > in 2), i.e., for each group set a rerank collector... but I'm not sure if > > this solution > > is feasable since the collectors are set in Lucene > > (AbstractSecondPassGroupingCollector) > > and a RankQuery is defined in Solr... > > > > Any suggestion? > > > > Thanks, > > Diego > > > > [1] https://cwiki.apache.org/confluence/display/solr/Result+Grouping > > [2] https://cwiki.apache.org/confluence/display/solr/Query+Re-Ranking > > >