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 2022/03/01 08:13:21 UTC

[GitHub] [lucene] iverase commented on a change in pull request #687: LUCENE-10425:speed up IndexSortSortedNumericDocValuesRangeQuery#BoundedDocSetIdIterator construction using bkd binary search

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



##########
File path: lucene/sandbox/src/java/org/apache/lucene/sandbox/search/IndexSortSortedNumericDocValuesRangeQuery.java
##########
@@ -181,12 +189,159 @@ public int count(LeafReaderContext context) throws IOException {
     };
   }
 
+  /**
+   * Returns the first document whose packed value is greater than or equal (if allowEqual is true) to the provided packed value
+   * or -1 if all packed values are smaller than the provided one,
+   */
+  public final int nextDoc(PointValues values, byte[] packedValue, boolean allowEqual) throws IOException {
+      final int numIndexDimensions = values.getNumIndexDimensions();
+      final int bytesPerDim = values.getBytesPerDimension();
+      final ByteArrayComparator comparator = ArrayUtil.getUnsignedComparator(bytesPerDim);
+      final Predicate<byte[]> biggerThan = testPackedValue -> {
+          for (int dim = 0; dim < numIndexDimensions; dim++) {
+              final int offset = dim * bytesPerDim;

Review comment:
       Test seems to be always with one dimension and I think this query can only be used in the 1D case. Can we simplify here and everywhere where we loop through dimensions?




-- 
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-unsubscribe@lucene.apache.org

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