jpountz commented on a change in pull request #1263: LUCENE-9228: Sort dv 
updates by terms by applying
URL: https://github.com/apache/lucene-solr/pull/1263#discussion_r380534145
 
 

 ##########
 File path: 
lucene/core/src/java/org/apache/lucene/index/FrozenBufferedUpdates.java
 ##########
 @@ -808,10 +808,17 @@ private void setField(String field) throws IOException {
         } else {
           termsEnum = null;
         }
+        currentTermVisited = false;
       }
     }
 
-    DocIdSetIterator nextTerm(String field, BytesRef term) throws IOException {
+    /**
+     * Returns a {@link DocIdSetIterator} for the given field and term if 
exists. If the parameter
+     * {@code skipIfTermVisited} is true, then this method will return null if 
the given and field
+     * was visited already. This optimization is currently used in
+     * {@link #applyDocValuesUpdates(BufferedUpdatesStream.SegmentState, Map, 
long, boolean)}
+     */
+    DocIdSetIterator nextTerm(String field, BytesRef term, boolean 
skipIfTermVisited) throws IOException {
 
 Review comment:
   I was expecting this `skipIfTermVisited` logic could go to 
`BufferedUpdateIterator` instead? So `TermDocsIterator` would be left untouched 
and `BufferedUpdateIterator` would silently skip duplicate terms when the 
optimization kicks in? (It's very possible that I'm missing something and that 
it's not doable)

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to