You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "hanbj (via GitHub)" <gi...@apache.org> on 2025/04/01 08:14:44 UTC
Re: [PR] Reduce the number of comparisons when lowerPoint is equal to upperPoint [lucene]
hanbj commented on code in PR #14267:
URL: https://github.com/apache/lucene/pull/14267#discussion_r2022373498
##########
lucene/core/src/java/org/apache/lucene/search/PointRangeQuery.java:
##########
@@ -129,6 +141,16 @@ public final Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, fl
private boolean matches(byte[] packedValue) {
int offset = 0;
+
+ if (equalValues) {
+ for (int dim = 0; dim < numDims; dim++, offset += bytesPerDim) {
+ if (comparator.compare(packedValue, offset, lowerPoint, offset) != 0) {
+ return false;
+ }
+ }
+ return true;
+ }
Review Comment:
This implementation will result in a lot of code duplication. I will implement it first. Thank you for your hard work in the review.
--
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