gf2121 opened a new issue, #12028: URL: https://github.com/apache/lucene/issues/12028
### Description Today `TermInSetQuery` can be rewritten to disjunction BooleanQuery to lazily materialize query result if terms count < 16. This can significantly improve query performance in cases like `selective_clause AND low_cardinality_field in (xxx) `. Recently we added IntField, LongField, FloatField, DoubleField to index both with points and doc values (https://github.com/apache/lucene/issues/11199). `xxxField#newExactQuery` now can take advantage of `IndexOrDocValuesQuery` to match with DocValues when there is a selective conjunction clause. I wonder if we can have `xxxField#newSetQuery` that generates disjunction BooleanQuery when points count < 16 ? For example: ``` public static Query newSetQuery(String field, long... values) { if (values.length < 16) { BooleanQuery.Builder builder = new BooleanQuery.Builder(); for (long value: values) { builder.add(newExactQuery(field, value), Occur.FILTER); } return builder.build(); } return LongPoint.newSetQuery(field, values); } ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org