micpalmia commented on a change in pull request #1343: LUCENE-8103: Use 
two-phase iteration in Query- and DoubleValuesSource
URL: https://github.com/apache/lucene-solr/pull/1343#discussion_r392569098
 
 

 ##########
 File path: 
lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/QueryValueSource.java
 ##########
 @@ -156,42 +135,38 @@ public float floatVal(int doc) {
   @Override
   public boolean exists(int doc) {
     try {
-      if (doc < lastDocRequested) {
-        if (noMatches) return false;
+      if (noMatches) return false;
+      if (scorer == null) {
         scorer = weight.scorer(readerContext);
-        scorerDoc = -1;
-        if (scorer==null) {
+        if (scorer == null) {
           noMatches = true;
           return false;
         }
-        it = scorer.iterator();
+        tpi = scorer.twoPhaseIterator();
+        disi = tpi==null ? scorer.iterator() : tpi.approximation();
+        thisDocMatches = false;
 
 Review comment:
   The disi is positioned on -1, so definitely not a match, no?

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