cpoerschke commented on a change in pull request #151: URL: https://github.com/apache/solr/pull/151#discussion_r645874791
########## 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: > Hi @cpoerschke please excuse the delay, I am very sorry! Hi @tomglk, no worries at all and nothing to be sorry about, we all contribute here as and when time permits. :) > I just found time to look at your commit. Thank you for taking a look at the commit! > The tests fail because they assume, that the number of reRankDocs is applied to the whole result. Your change applies it to each shard. ... > ... Because the client cannot (and should not have to) know, how many shards the cluster has ... > ... if the reRankScore for all docs on shard2 is higher then the score for each reRanked doc on shard1. ... Yes, very well put, so this all shows then that (with my change applied) someone (Solr or the client) doing `reRankDocs / numShard` could give different results than `reRankDocs` for a single sharded collection. > That's a bit sad, ... Yes it is. Hmm, so let's maybe then loop back to and continue with your idea of a multi-part solution? I.e. this pull request to fix for use cases with a score-free sort and future pull request(s) for use cases whose sort contains a score (and which therefore requires access to the original score in the coordinator but where it is currently not available). -- 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