uschindler commented on code in PR #12141:
URL: https://github.com/apache/lucene/pull/12141#discussion_r1102816225
##########
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:
I checked the code, we have several callers now, some using the array, some
the stream one. I'd like to keep the stream abstraction here.
If we change to use streams in general (when we have the possibility to
improve IndexOrDocavaluesQuery by lazy initializing the child queries I am
happy to refactor this.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]