remove guava usage from IdsQueryBuilder

This commit is contained in:
javanna 2015-09-11 14:20:21 +02:00 committed by Luca Cavanna
parent 73f7df510e
commit e522458735
1 changed files with 3 additions and 4 deletions

View File

@ -19,8 +19,6 @@
package org.elasticsearch.index.query; package org.elasticsearch.index.query;
import com.google.common.collect.Sets;
import org.apache.lucene.queries.TermsQuery; import org.apache.lucene.queries.TermsQuery;
import org.apache.lucene.search.Query; import org.apache.lucene.search.Query;
import org.elasticsearch.cluster.metadata.MetaData; import org.elasticsearch.cluster.metadata.MetaData;
@ -42,7 +40,7 @@ public class IdsQueryBuilder extends AbstractQueryBuilder<IdsQueryBuilder> {
public static final String NAME = "ids"; public static final String NAME = "ids";
private final Set<String> ids = Sets.newHashSet(); private final Set<String> ids = new HashSet<>();
private final String[] types; private final String[] types;
@ -135,7 +133,8 @@ public class IdsQueryBuilder extends AbstractQueryBuilder<IdsQueryBuilder> {
} else if (types.length == 1 && MetaData.ALL.equals(types[0])) { } else if (types.length == 1 && MetaData.ALL.equals(types[0])) {
typesForQuery = context.mapperService().types(); typesForQuery = context.mapperService().types();
} else { } else {
typesForQuery = Sets.newHashSet(types); typesForQuery = new HashSet<>();
Collections.addAll(typesForQuery, types);
} }
query = new TermsQuery(UidFieldMapper.NAME, Uid.createUidsForTypesAndIds(typesForQuery, ids)); query = new TermsQuery(UidFieldMapper.NAME, Uid.createUidsForTypesAndIds(typesForQuery, ids));