parent
d2416a3a40
commit
53f6d9412e
|
@ -25,6 +25,7 @@ import org.apache.lucene.search.MatchNoDocsQuery;
|
||||||
import org.apache.lucene.search.Query;
|
import org.apache.lucene.search.Query;
|
||||||
import org.elasticsearch.cluster.metadata.MetaData;
|
import org.elasticsearch.cluster.metadata.MetaData;
|
||||||
import org.elasticsearch.common.ParsingException;
|
import org.elasticsearch.common.ParsingException;
|
||||||
|
import org.elasticsearch.index.mapper.UidFieldMapper;
|
||||||
import org.elasticsearch.search.internal.SearchContext;
|
import org.elasticsearch.search.internal.SearchContext;
|
||||||
import org.elasticsearch.test.AbstractQueryTestCase;
|
import org.elasticsearch.test.AbstractQueryTestCase;
|
||||||
|
|
||||||
|
@ -73,7 +74,8 @@ public class IdsQueryBuilderTests extends AbstractQueryTestCase<IdsQueryBuilder>
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doAssertLuceneQuery(IdsQueryBuilder queryBuilder, Query query, SearchContext context) throws IOException {
|
protected void doAssertLuceneQuery(IdsQueryBuilder queryBuilder, Query query, SearchContext context) throws IOException {
|
||||||
if (queryBuilder.ids().size() == 0) {
|
if (queryBuilder.ids().size() == 0 || queryBuilder.types().length == 0 ||
|
||||||
|
(queryBuilder.types().length == 1 && queryBuilder.types()[0].equals(MetaData.ALL))) {
|
||||||
assertThat(query, instanceOf(MatchNoDocsQuery.class));
|
assertThat(query, instanceOf(MatchNoDocsQuery.class));
|
||||||
} else {
|
} else {
|
||||||
assertThat(query, instanceOf(TermInSetQuery.class));
|
assertThat(query, instanceOf(TermInSetQuery.class));
|
||||||
|
|
Loading…
Reference in New Issue