[ https://issues.apache.org/jira/browse/LUCENE-10378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17488790#comment-17488790 ]
Ignacio Vera edited comment on LUCENE-10378 at 2/8/22, 11:48 AM: ----------------------------------------------------------------- Hi Gautam! Thanks for the PR but you are right, I think the idea from Adrien is to avoid visiting nodes when we know that it is inside our query. In that case you can call directly PointTree#size to compute the number of points/documents to be added to the final result. I think you can start by implementing the following function in PointValues: {code:java} /** * Finds the number of points matching the provided conditions. This method does not enforce live * documents, therefore it should only be used when there are no deleted documents. */ public final long pointCount(BiFunction<byte[], byte[], Relation> nodeComparator, Predicate<byte[]> leafComparator) throws IOException;{code} This is the function you want to call when you know the number of points is equal to the number of documents. was (Author: ivera): Hi Gautam! Thanks for the PR but you are right, I think the idea from Adrien is to avoid visiting nodes when we know that it is inside our query. In that case you can call directly PointTree#size to compute the number of points/documents to be added to the final result. I think you can start by implementing the following function in PointValues: {code:java} /** * Finds the number of points matching the provided conditions. This method does not enforce live * documents, therefore it should only be used when there are no deleted documents. */ public final long pointCount(BiFunction<byte[], byte[], Relation> nodeComparator, Predicate<byte[]> leafComparator) throws IOException;{code} This is the function you want to call when you know the number of points is equal to the number of values. > Implement Weight#count on PointRangeQuery > ----------------------------------------- > > Key: LUCENE-10378 > URL: https://issues.apache.org/jira/browse/LUCENE-10378 > Project: Lucene - Core > Issue Type: Task > Reporter: Adrien Grand > Priority: Minor > Time Spent: 10m > Remaining Estimate: 0h > > When there are no deletions and the field is single-valued (docCount == size) > and has a single-dimension, PointRangeQuery could implement {{Weight#count}} > by only counting matches on the two leaves that cross with the query. -- This message was sent by Atlassian Jira (v8.20.1#820001) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org