mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-25 14:26:27 +00:00
TermsQueryBuilder: removing guava Longs
This commit is contained in:
parent
ff74e94260
commit
c5a7fedb23
@ -22,7 +22,6 @@ package org.elasticsearch.index.query;
|
||||
import com.google.common.primitives.Doubles;
|
||||
import com.google.common.primitives.Floats;
|
||||
import com.google.common.primitives.Ints;
|
||||
import com.google.common.primitives.Longs;
|
||||
import org.apache.lucene.index.Term;
|
||||
import org.apache.lucene.queries.TermsQuery;
|
||||
import org.apache.lucene.search.BooleanClause;
|
||||
@ -103,7 +102,14 @@ public class TermsQueryBuilder extends AbstractQueryBuilder<TermsQueryBuilder> {
|
||||
* @param values The terms
|
||||
*/
|
||||
public TermsQueryBuilder(String fieldName, long... values) {
|
||||
this(fieldName, values != null ? Longs.asList(values) : (Iterable<?>) null);
|
||||
if (values == null) {
|
||||
throw new IllegalArgumentException("No value specified for terms query");
|
||||
}
|
||||
this.fieldName = fieldName;
|
||||
this.values = new ArrayList<>(values.length);
|
||||
for (long longValue : values) {
|
||||
this.values.add(longValue);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user