You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/10/06 21:50:07 UTC

[GitHub] [lucene-solr] mayya-sharipova opened a new pull request #1955: LUCENE-9566 Move collectorIterator to the same doc as scorerIterator

mayya-sharipova opened a new pull request #1955:
URL: https://github.com/apache/lucene-solr/pull/1955


   


----------------------------------------------------------------
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:
users@infra.apache.org



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


[GitHub] [lucene-solr] jpountz commented on a change in pull request #1955: LUCENE-9566 Move collectorIterator to the same doc as scorerIterator

Posted by GitBox <gi...@apache.org>.
jpountz commented on a change in pull request #1955:
URL: https://github.com/apache/lucene-solr/pull/1955#discussion_r500624839



##########
File path: lucene/core/src/java/org/apache/lucene/search/Weight.java
##########
@@ -204,21 +204,21 @@ public int score(LeafCollector collector, Bits acceptDocs, int min, int max) thr
       collector.setScorer(scorer);
       DocIdSetIterator scorerIterator = twoPhase == null ? iterator : twoPhase.approximation();
       DocIdSetIterator collectorIterator = collector.competitiveIterator();
-      DocIdSetIterator filteredIterator;
-      if (collectorIterator == null) {
-        filteredIterator = scorerIterator;
-      } else {
-        if (scorerIterator.docID() != -1) {
-          // Wrap ScorerIterator to start from -1 for conjunction 
-          scorerIterator = new RangeDISIWrapper(scorerIterator, max);
-        }
-        // filter scorerIterator to keep only competitive docs as defined by collector
-        filteredIterator = ConjunctionDISI.intersectIterators(Arrays.asList(scorerIterator, collectorIterator));
-      }
+      DocIdSetIterator filteredIterator = scorerIterator;
       if (filteredIterator.docID() == -1 && min == 0 && max == DocIdSetIterator.NO_MORE_DOCS) {
+        if (collectorIterator != null) {
+          filteredIterator = ConjunctionDISI.intersectIterators(Arrays.asList(scorerIterator, collectorIterator));
+        }
         scoreAll(collector, filteredIterator, twoPhase, acceptDocs);
         return DocIdSetIterator.NO_MORE_DOCS;
       } else {
+        if (collectorIterator != null) {
+          if (scorerIterator.docID() != -1) {
+            // here we assume that the initial version of collectorIterator matches all docs and can advance exactly to the desired docID

Review comment:
       but that's not true, it it?




----------------------------------------------------------------
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:
users@infra.apache.org



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


[GitHub] [lucene-solr] mayya-sharipova merged pull request #1955: LUCENE-9566 TestApproximationSearchEquivalence.testExclusion fix

Posted by GitBox <gi...@apache.org>.
mayya-sharipova merged pull request #1955:
URL: https://github.com/apache/lucene-solr/pull/1955


   


----------------------------------------------------------------
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:
users@infra.apache.org



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


[GitHub] [lucene-solr] mayya-sharipova commented on a change in pull request #1955: LUCENE-9566 Move collectorIterator to the same doc as scorerIterator

Posted by GitBox <gi...@apache.org>.
mayya-sharipova commented on a change in pull request #1955:
URL: https://github.com/apache/lucene-solr/pull/1955#discussion_r500708276



##########
File path: lucene/core/src/java/org/apache/lucene/search/Weight.java
##########
@@ -204,21 +204,21 @@ public int score(LeafCollector collector, Bits acceptDocs, int min, int max) thr
       collector.setScorer(scorer);
       DocIdSetIterator scorerIterator = twoPhase == null ? iterator : twoPhase.approximation();
       DocIdSetIterator collectorIterator = collector.competitiveIterator();
-      DocIdSetIterator filteredIterator;
-      if (collectorIterator == null) {
-        filteredIterator = scorerIterator;
-      } else {
-        if (scorerIterator.docID() != -1) {
-          // Wrap ScorerIterator to start from -1 for conjunction 
-          scorerIterator = new RangeDISIWrapper(scorerIterator, max);
-        }
-        // filter scorerIterator to keep only competitive docs as defined by collector
-        filteredIterator = ConjunctionDISI.intersectIterators(Arrays.asList(scorerIterator, collectorIterator));
-      }
+      DocIdSetIterator filteredIterator = scorerIterator;
       if (filteredIterator.docID() == -1 && min == 0 && max == DocIdSetIterator.NO_MORE_DOCS) {
+        if (collectorIterator != null) {
+          filteredIterator = ConjunctionDISI.intersectIterators(Arrays.asList(scorerIterator, collectorIterator));
+        }
         scoreAll(collector, filteredIterator, twoPhase, acceptDocs);
         return DocIdSetIterator.NO_MORE_DOCS;
       } else {
+        if (collectorIterator != null) {
+          if (scorerIterator.docID() != -1) {
+            // here we assume that the initial version of collectorIterator matches all docs and can advance exactly to the desired docID

Review comment:
       @jpountz  My last [commit](4c5d8284941d315b7f15d819fbbc5d156421f02d) seems to address the test failures.  I think it may work. Sorry again for the trouble. 




----------------------------------------------------------------
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:
users@infra.apache.org



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


[GitHub] [lucene-solr] mayya-sharipova commented on a change in pull request #1955: LUCENE-9566 Move collectorIterator to the same doc as scorerIterator

Posted by GitBox <gi...@apache.org>.
mayya-sharipova commented on a change in pull request #1955:
URL: https://github.com/apache/lucene-solr/pull/1955#discussion_r500708276



##########
File path: lucene/core/src/java/org/apache/lucene/search/Weight.java
##########
@@ -204,21 +204,21 @@ public int score(LeafCollector collector, Bits acceptDocs, int min, int max) thr
       collector.setScorer(scorer);
       DocIdSetIterator scorerIterator = twoPhase == null ? iterator : twoPhase.approximation();
       DocIdSetIterator collectorIterator = collector.competitiveIterator();
-      DocIdSetIterator filteredIterator;
-      if (collectorIterator == null) {
-        filteredIterator = scorerIterator;
-      } else {
-        if (scorerIterator.docID() != -1) {
-          // Wrap ScorerIterator to start from -1 for conjunction 
-          scorerIterator = new RangeDISIWrapper(scorerIterator, max);
-        }
-        // filter scorerIterator to keep only competitive docs as defined by collector
-        filteredIterator = ConjunctionDISI.intersectIterators(Arrays.asList(scorerIterator, collectorIterator));
-      }
+      DocIdSetIterator filteredIterator = scorerIterator;
       if (filteredIterator.docID() == -1 && min == 0 && max == DocIdSetIterator.NO_MORE_DOCS) {
+        if (collectorIterator != null) {
+          filteredIterator = ConjunctionDISI.intersectIterators(Arrays.asList(scorerIterator, collectorIterator));
+        }
         scoreAll(collector, filteredIterator, twoPhase, acceptDocs);
         return DocIdSetIterator.NO_MORE_DOCS;
       } else {
+        if (collectorIterator != null) {
+          if (scorerIterator.docID() != -1) {
+            // here we assume that the initial version of collectorIterator matches all docs and can advance exactly to the desired docID

Review comment:
       @jpountz  My last  commit 4c5d8284941d315b7f15d819fbbc5d156421f02d seems to address the test failures.  I think it may work. Sorry again for the trouble. 




----------------------------------------------------------------
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:
users@infra.apache.org



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


[GitHub] [lucene-solr] mayya-sharipova commented on a change in pull request #1955: LUCENE-9566 Move collectorIterator to the same doc as scorerIterator

Posted by GitBox <gi...@apache.org>.
mayya-sharipova commented on a change in pull request #1955:
URL: https://github.com/apache/lucene-solr/pull/1955#discussion_r500673813



##########
File path: lucene/core/src/java/org/apache/lucene/search/Weight.java
##########
@@ -204,21 +204,21 @@ public int score(LeafCollector collector, Bits acceptDocs, int min, int max) thr
       collector.setScorer(scorer);
       DocIdSetIterator scorerIterator = twoPhase == null ? iterator : twoPhase.approximation();
       DocIdSetIterator collectorIterator = collector.competitiveIterator();
-      DocIdSetIterator filteredIterator;
-      if (collectorIterator == null) {
-        filteredIterator = scorerIterator;
-      } else {
-        if (scorerIterator.docID() != -1) {
-          // Wrap ScorerIterator to start from -1 for conjunction 
-          scorerIterator = new RangeDISIWrapper(scorerIterator, max);
-        }
-        // filter scorerIterator to keep only competitive docs as defined by collector
-        filteredIterator = ConjunctionDISI.intersectIterators(Arrays.asList(scorerIterator, collectorIterator));
-      }
+      DocIdSetIterator filteredIterator = scorerIterator;
       if (filteredIterator.docID() == -1 && min == 0 && max == DocIdSetIterator.NO_MORE_DOCS) {
+        if (collectorIterator != null) {
+          filteredIterator = ConjunctionDISI.intersectIterators(Arrays.asList(scorerIterator, collectorIterator));
+        }
         scoreAll(collector, filteredIterator, twoPhase, acceptDocs);
         return DocIdSetIterator.NO_MORE_DOCS;
       } else {
+        if (collectorIterator != null) {
+          if (scorerIterator.docID() != -1) {
+            // here we assume that the initial version of collectorIterator matches all docs and can advance exactly to the desired docID

Review comment:
       Thanks for the comment, I will think about this more




----------------------------------------------------------------
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:
users@infra.apache.org



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