You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by ilaygit <gi...@git.apache.org> on 2018/05/02 09:25:27 UTC

[GitHub] lucene-solr pull request #162: SOLR-8776: Support RankQuery in grouping

Github user ilaygit commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/162#discussion_r185438730
  
    --- Diff: solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java ---
    @@ -1414,10 +1267,17 @@ private void doProcessGroupedDistributedSearchFirstPhase(ResponseBuilder rb, Que
             .setSearcher(searcher);
     
         for (String field : groupingSpec.getFields()) {
    +      final int topNGroups;
    +      Query query = cmd.getQuery();
    +      if (query instanceof AbstractReRankQuery){
    +        topNGroups = cmd.getOffset() + ((AbstractReRankQuery)query).getReRankDocs();
    +      } else {
    +        topNGroups = cmd.getOffset() + cmd.getLen();
    +      }
           topsGroupsActionBuilder.addCommandField(new SearchGroupsFieldCommand.Builder()
               .setField(schema.getField(field))
               .setGroupSort(groupingSpec.getGroupSort())
    -          .setTopNGroups(cmd.getOffset() + cmd.getLen())
    --- End diff --
    
    Is it reRanking with respect to the "start" param in the solr query?
    Looks like the original LTR plugin is supposed to reRank top K irrespective of the offset.
    ref.http://lucene.472066.n3.nabble.com/Learning-to-Rank-LTR-with-grouping-td4366691i20.html#a4387929


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org