gf2121 commented on code in PR #14523:
URL: https://github.com/apache/lucene/pull/14523#discussion_r2050789304


##########
lucene/core/src/java/org/apache/lucene/search/DisjunctionDISIApproximation.java:
##########
@@ -146,7 +146,13 @@ public int advance(int target) throws IOException {
   @Override
   public void intoBitSet(int upTo, FixedBitSet bitSet, int offset) throws 
IOException {
     while (leadTop.doc < upTo) {
-      leadTop.approximation.intoBitSet(upTo, bitSet, offset);
+      int intoBitSetBase = offset;
+      if (leadTop.approximation.docID() < offset) {
+        intoBitSetBase = leadTop.approximation.advance(offset);
+      }
+      if (intoBitSetBase < upTo) {
+        leadTop.approximation.intoBitSet(upTo, bitSet, intoBitSetBase);

Review Comment:
   Likewise here, i do not think we should change the offset? it makes the 
conjunction/disjunction meaningless.



##########
lucene/core/src/java/org/apache/lucene/search/DocIdSetIterator.java:
##########
@@ -203,7 +203,8 @@ protected final int slowAdvance(int target) throws 
IOException {
    * @lucene.internal
    */
   public void intoBitSet(int upTo, FixedBitSet bitSet, int offset) throws 
IOException {
-    assert offset <= docID();
+    assert offset <= docID() && offset <= upTo

Review Comment:
   Do we really need to assert offset <= upTo? Like we pass upTo=0 in, we just 
do nothing and return, which seems correct?



##########
lucene/core/src/java/org/apache/lucene/search/DenseConjunctionBulkScorer.java:
##########
@@ -236,10 +236,13 @@ private void scoreWindowUsingBitSet(
       windowMatches.set(0, windowMax - windowBase);
     } else {
       DocIdSetIterator lead = iterators.get(0);
+      int intoBitSetBase = windowBase;
       if (lead.docID() < windowBase) {
-        lead.advance(windowBase);
+        intoBitSetBase = lead.advance(windowBase);
+      }
+      if (intoBitSetBase < windowMax) {
+        lead.intoBitSet(windowMax, windowMatches, intoBitSetBase);

Review Comment:
   This does not seem correct to me: lead clause and other clause are 
intersecting with different offsets?



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

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to