jpountz commented on code in PR #14435: URL: https://github.com/apache/lucene/pull/14435#discussion_r2028403966
########## lucene/core/src/java/org/apache/lucene/document/KeywordField.java: ########## @@ -175,9 +174,8 @@ public static Query newExactQuery(String field, String value) { public static Query newSetQuery(String field, Collection<BytesRef> values) { Objects.requireNonNull(field, "field must not be null"); Objects.requireNonNull(values, "values must not be null"); - Query indexQuery = new TermInSetQuery(field, values); - Query dvQuery = new TermInSetQuery(MultiTermQuery.DOC_VALUES_REWRITE, field, values); - return new IndexOrDocValuesQuery(indexQuery, dvQuery); + return TermInSetQuery.newIndexOrDocValuesQuery( + MultiTermQuery.CONSTANT_SCORE_BLENDED_REWRITE, field, values); Review Comment: I would agree with this. `KeywordField#newSetQuery` is the convenience method, so it's nice to not have to pass a rewrite, `TermInSetQuery#newIndexOrDocValuesQuery` is the expert method, and experts can figure out how they want their multi-term queries to be rewritten. -- 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 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