Description
TermsQuery helps when there are lot of terms from which you would like to compute the union, but it is a bit harmful when you have few terms since it cannot really skip: it always consumes all documents matching the underlying terms.
It would certainly help to rewrite this query to a ConstantScoreQuery over a BooleanQuery when there are few terms in order to have actual skip support.
As usual the hard part is probably to figure out the threshold.
Attachments
Attachments
Issue Links
- is duplicated by
-
LUCENE-6460 TermsQuery should rewrite to BooleanQuery if < 50 terms
- Closed