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/16 18:49:58 UTC

[GitHub] [lucene] jtibshirani commented on a change in pull request #736: LUCENE-10458: BoundedDocSetIdIterator may supply error count in Weigth#count(LeafReaderContext) when missingValue enables

jtibshirani commented on a change in pull request #736:
URL: https://github.com/apache/lucene/pull/736#discussion_r828333005



##########
File path: lucene/sandbox/src/java/org/apache/lucene/sandbox/search/IndexSortSortedNumericDocValuesRangeQuery.java
##########
@@ -198,16 +200,23 @@ public boolean isCacheable(LeafReaderContext ctx) {
 
       @Override
       public int count(LeafReaderContext context) throws IOException {
-        BoundedDocSetIdIterator disi = getDocIdSetIteratorOrNull(context);
-        if (disi != null) {
+
+        BoundedDocIdSetIterator disi = getDocIdSetIteratorOrNull(context);
+        if (disi != null && disi.delegate == null) {
           return disi.lastDoc - disi.firstDoc;
         }
-        return fallbackWeight.count(context);
+
+        PointValues pointValues = context.reader().getPointValues(field);

Review comment:
       If there's a fallback query provided, it's guaranteed to match the same documents (from the javadoc: "This fallback must be an equivalent range query -- it should produce the same documents and give constant scores"). There's nothing in this query that guarantees the fallback query uses point values, so the check feels out of place.




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