HoustonPutman commented on issue #14455: URL: https://github.com/apache/lucene/issues/14455#issuecomment-2798145654
I just realized that the first part of the method resorts on docId to start. So we would need to sort the original-order `hits` from the `firstPassTopDocs` passed to the method. Something like this: ```java Comparator<ScoreDoc> sortDocComparator = Comparator.<ScoreDoc>comparingDouble(sd -> sd.score).reversed(); if (useStableSort) { hits = firstPassTopDocs.scoreDocs.clone(); } ``` Since if `useStableSort` is `false`, hits is already presorted by docId, so no need to include that in the sort anyways. -- 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. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org