iverase commented on a change in pull request #499:
URL: https://github.com/apache/lucene/pull/499#discussion_r761227803



##########
File path: lucene/core/src/java/org/apache/lucene/util/FixedBitSet.java
##########
@@ -351,16 +351,38 @@ private void and(final long[] otherArr, final int 
otherNumWords) {
     }
   }
 
+  public void andNot(DocIdSetIterator iter) throws IOException {
+    if (BitSetIterator.getFixedBitSetOrNull(iter) != null) {

Review comment:
       Can we add some unit test for this new method?

##########
File path: 
lucene/core/src/java/org/apache/lucene/document/LatLonPointDistanceQuery.java
##########
@@ -295,6 +295,12 @@ public void visit(int docID) {
             cost[0]--;
           }
 
+          @Override
+          public void visit(DocIdSetIterator iterator) throws IOException {
+            result.andNot(iterator);
+            cost[0] = (int) Math.max(0, cost[0] - iterator.cost());
+          }

Review comment:
       Actually, can we make the cost to be a long[]? It is going to be cast to 
a long later on anyway. 

##########
File path: lucene/core/src/java/org/apache/lucene/search/PointRangeQuery.java
##########
@@ -217,6 +217,12 @@ public void visit(int docID) {
             cost[0]--;
           }
 
+          @Override
+          public void visit(DocIdSetIterator iterator) throws IOException {
+            result.andNot(iterator);
+            cost[0] = (int) Math.max(0, cost[0] - iterator.cost());
+          }

Review comment:
       Here as well, make cost a long[].




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