rmuir commented on code in PR #12141: URL: https://github.com/apache/lucene/pull/12141#discussion_r1102797942
########## lucene/core/src/java/org/apache/lucene/document/SortedSetDocValuesSetQuery.java: ########## @@ -51,20 +54,23 @@ final class SortedSetDocValuesSetQuery extends Query implements Accountable { private final PrefixCodedTerms termData; private final int termDataHashCode; // cached hashcode of termData - SortedSetDocValuesSetQuery(String field, BytesRef terms[]) { + /** + * Creates a new {@link TermInSetQuery} from the given collection of terms. This is most efficient + * if it is a sorted set or any other collection which has a presorted and distinct spliterator. + */ + SortedSetDocValuesSetQuery(String field, Collection<BytesRef> terms) { + this(field, terms.stream()); + } + + /** Creates a new {@link TermInSetQuery} from the given array of terms. */ + SortedSetDocValuesSetQuery(String field, BytesRef... terms) { + this(field, Arrays.stream(terms)); + } + + private SortedSetDocValuesSetQuery(String field, Stream<BytesRef> stream) { Review Comment: do we really need 3 ctors or could we just have a single package private ctor taking stream. The XXXField classes could just call .stream method? I just don't know if we need so much "sugar" for classes that are entirely package private. Unfortunately, the TermInSetQuery is a public class, so maybe there are different concerns there. -- 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