cpoerschke commented on a change in pull request #151: URL: https://github.com/apache/solr/pull/151#discussion_r641707464
########## File path: solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java ########## @@ -999,20 +1013,34 @@ protected void mergeIds(ResponseBuilder rb, ShardRequest sreq) { shardDoc.sortFieldValues = unmarshalledSortFieldValues; - queue.insertWithOverflow(shardDoc); + if(reRankQueue != null && docCounter++ <= reRankDocsSize) { + ShardDoc droppedShardDoc = reRankQueue.insertWithOverflow(shardDoc); + // FIXME: Only works if the original request does not sort by score Review comment: \<thinking out aloud\> > ... The reRankDocs-param which specifies the amount of docs that should be reRanked, is used per shard, but also has to be applied while combining the results. ... > Example: ... reRankDocs = 2 shard1: ... shard2: ... Might it be helpful to include in the example the original score for doc_1 and doc_4 and to have a "pre-example" of what the logic and outcome is if the collection was single sharded and a "post-example" for (say) 4-sharded? Can distributed, sharded re-ranking arrive at exactly the same outcome? Might the _"but also has to be applied while combining the results"_ be up-for-debate e.g. a reRankDocs on shard level and a (possibly different) foobarReRankDocs on the federation level? > ... We have no access to the score before reRanking at this point and I currently see no possibility to retrieve it again. ... Conceptually if a feature store had an `OriginalScoreFeature` and `fl=[fv]` feature values were requested then in terms of "transport" the score before reRanking could be available in the federator. As a proof-of-concept that could be explored by making sure the store has the feature and the fl asks for the feature values. As a real implementation it could be a bit messy to capture, send and use the score that way. And actually, hmm, the score might be available via the `fl` via the "get fields" part of the distributed use of the query component but if/since the id merging happens before "get fields" then yes no original score available during merging. \</thinking out aloud\> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org