Fix ids query builder test to use the same logic for matchnodocs as the

builder itself
This commit is contained in:
Ryan Ernst 2017-05-09 16:53:19 -07:00
parent ebd3e5f73f
commit 5242d3aeb0
1 changed files with 1 additions and 2 deletions

View File

@ -74,8 +74,7 @@ public class IdsQueryBuilderTests extends AbstractQueryTestCase<IdsQueryBuilder>
@Override
protected void doAssertLuceneQuery(IdsQueryBuilder queryBuilder, Query query, SearchContext context) throws IOException {
if (queryBuilder.ids().size() == 0 || queryBuilder.types().length == 0 ||
(queryBuilder.types().length == 1 && queryBuilder.types()[0].equals(MetaData.ALL))) {
if (queryBuilder.ids().size() == 0 || context.getQueryShardContext().fieldMapper(UidFieldMapper.NAME) == null) {
assertThat(query, instanceOf(MatchNoDocsQuery.class));
} else {
assertThat(query, instanceOf(TermInSetQuery.class));