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