jpountz commented on a change in pull request #734: LUCENE-8857: Introduce 
Custom Tiebreakers in TopDocs#merge
URL: https://github.com/apache/lucene-solr/pull/734#discussion_r297559142
 
 

 ##########
 File path: lucene/core/src/java/org/apache/lucene/search/TopDocs.java
 ##########
 @@ -28,6 +30,25 @@
   /** The top hits for the query. */
   public ScoreDoc[] scoreDocs;
 
+  /** Internal comparator with shardIndex */
+  private static final Comparator<ScoreDoc> shardIndexTieBreaker = 
Comparator.comparingInt(d -> d.shardIndex);
+
+  /** Internal comparator with docID */
+  private static final Comparator<ScoreDoc> docIDTieBreaker = 
Comparator.comparingInt(d -> d.doc);
+
+  /** Default comparator */
+  private static final Comparator<ScoreDoc> defaultTieBreaker = new 
Comparator<ScoreDoc>() {
 
 Review comment:
   this could be `shardIndexTieBreaker.thenComparing(docIDTieBreaker)`

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to