mayya-sharipova commented on a change in pull request #32:
URL: https://github.com/apache/lucene/pull/32#discussion_r600414533



##########
File path: lucene/core/src/java/org/apache/lucene/index/BaseCompositeReader.java
##########
@@ -231,4 +239,13 @@ protected final int readerBase(int readerIndex) {
   protected final List<? extends R> getSequentialSubReaders() {
     return subReadersList;
   }
+
+  /**
+   * Returns a comparator for sorting sub readers.
+   *
+   * @return a comparator for sorting sub readers, or {@code null} if a 
comparator was not set.
+   */
+  protected Comparator<R> getSubReadersSorter() {
+    return subReadersSorter;

Review comment:
       > .. if we wrap this reader in a FilterDirectoryReader, that wrapped 
reader will also sort its leaves the same way?
   
   Thank you , that's a very good point, you are right, indeed the wrapped 
reader will already sort its leaves the same way.  Fixed by removing `sorter` 
in `FilterDirectoryReader` in 34da11d80d30c1d4a418066edfadce0dde3379ae
   
   > .. why does the reader need to record its sorter? I guess maybe callers 
might want to "chain" the sorter -- have this reader remember what sorter was 
used, and on refresh, pull that sorter out and use it again for the next 
reader, ok.
   
   Right, indeed.  In `StandardDirectoryReader::doOpenIfChanged`, we reuse 
sorter.
   




-- 
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]



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

Reply via email to