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