#26145 Fix test expectation with MatchNoDocsQuery

This commit is contained in:
Jim Ferenczi 2017-08-21 14:17:23 +02:00
parent f3d109bad2
commit 8fd71a5d6d
1 changed files with 3 additions and 1 deletions

View File

@ -260,7 +260,9 @@ public class SimpleQueryStringBuilderTests extends AbstractQueryTestCase<SimpleQ
}
} else if (queryBuilder.fields().size() == 1) {
Map.Entry<String, Float> field = queryBuilder.fields().entrySet().iterator().next();
if (query instanceof MatchNoDocsQuery == false) {
assertTermOrBoostQuery(query, field.getKey(), queryBuilder.value(), field.getValue());
}
} else if (queryBuilder.fields().size() == 0) {
assertThat(query, either(instanceOf(DisjunctionMaxQuery.class)).or(instanceOf(MatchNoDocsQuery.class)));
if (query instanceof DisjunctionMaxQuery) {