apache / lucene

Apache Lucene open-source search software
https://lucene.apache.org/
Apache License 2.0
2.6k stars 1.01k forks source link

Delegating DocIdSetIterator could be replaced to DocIdSetIterator#range(int minDoc, int maxDoc) in IndexSortSortedNumericDocValuesRangeQuery [LUCENE-10460] #11496

Closed asfimport closed 2 years ago

asfimport commented 2 years ago

While taking advantage of of index sort In IndexSortSortedNumericDocValuesRangeQuery, if MissingValue disabled, all Documents between a range of firstDoc and lastDoc must contain DocValues. So In BoundedDocSetIdIterator#advance(int), the delegating DocIdSetIterator could be replaced to DocIdSetIterator#range(int minDoc, int maxDoc)?


Migrated from LUCENE-10460 by Lu Xugang (@LuXugang), resolved Mar 16 2022 Pull requests: https://github.com/apache/lucene/pull/742

asfimport commented 2 years ago

Julie Tibshirani (@jtibshirani) (migrated from JIRA)

It indeed seems okay to use a simple DocIdSetIterator#range in this case. I'm wondering about the motivation for specializing this case though, especially since the logic is already pretty complex. Have you seen it make a latency difference when there are missing values?  In the case with no missing values I don't think it will help much, since iterating dense doc values is already optimized (see DenseNumericDocValues).

asfimport commented 2 years ago

Lu Xugang (@LuXugang) (migrated from JIRA)

optimized by  #11494.