mirror of https://github.com/apache/lucene.git
LUCENE-10450: IndexSortSortedNumericDocValuesRangeQuery could be rewrite to MatchAllDocsQuery (#720)
This commit is contained in:
parent
c0d5022d5a
commit
1967942861
|
@ -201,6 +201,8 @@ Optimizations
|
|||
* LUCENE-10442: When indexQuery or/and dvQuery be a MatchAllDocsQuery
|
||||
then IndexOrDocValuesQuery should be rewrite to MatchAllDocsQuery. (Lu Xugang)
|
||||
|
||||
* LUCENE-10450: IndexSortSortedNumericDocValuesRangeQuery could be rewrite to MatchAllDocsQuery. (Lu Xugang)
|
||||
|
||||
Changes in runtime behavior
|
||||
---------------------
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ import org.apache.lucene.search.DocValuesFieldExistsQuery;
|
|||
import org.apache.lucene.search.FieldComparator;
|
||||
import org.apache.lucene.search.IndexSearcher;
|
||||
import org.apache.lucene.search.LeafFieldComparator;
|
||||
import org.apache.lucene.search.MatchAllDocsQuery;
|
||||
import org.apache.lucene.search.Query;
|
||||
import org.apache.lucene.search.QueryVisitor;
|
||||
import org.apache.lucene.search.ScoreMode;
|
||||
|
@ -140,6 +141,9 @@ public class IndexSortSortedNumericDocValuesRangeQuery extends Query {
|
|||
}
|
||||
|
||||
Query rewrittenFallback = fallbackQuery.rewrite(reader);
|
||||
if (rewrittenFallback.getClass() == MatchAllDocsQuery.class) {
|
||||
return new MatchAllDocsQuery();
|
||||
}
|
||||
if (rewrittenFallback == fallbackQuery) {
|
||||
return this;
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue