Description
Follow-up of SOLR-8251: APIs and user interfaces sometimes encourage to write BooleanQuery instances that are not optimal, for instance a typical case that happens often with Solr/Elasticsearch is to send a request that has a MatchAllDocsQuery as a query and some filter, which could be executed more efficiently by directly wrapping the filter into a ConstantScoreQuery.
Here are some ideas of rewrite operations that BooleanQuery could perform:
- remove FILTER clauses when they are also a MUST clause
- rewrite queries of the form "+: #filter" to a ConstantScoreQuery(filter)
- rewrite to a MatchNoDocsQuery when a clause that is a MUST or FILTER clause is also a MUST_NOT clause
Attachments
Attachments
Issue Links
- duplicates
-
LUCENE-6787 BooleanQuery should be able to drop duplicate non-scoring clauses
- Resolved
- is related to
-
SOLR-8251 MatchAllDocsQuery is much slower in solr5.3.1 compare to solr4.7
- Closed