Fixes QueryStringQueryBuilderTests
Closes
@@ -807,7 +807,8 @@ public class QueryStringQueryBuilderTests extends AbstractQueryTestCase<QueryStr
QueryStringQueryBuilder queryBuilder = new QueryStringQueryBuilder(STRING_FIELD_NAME + ":*");
Query query = queryBuilder.toQuery(context);
if (getCurrentTypes().length > 0) {
- if (context.getIndexSettings().getIndexVersionCreated().onOrAfter(Version.V_6_1_0)) {
+ if (context.getIndexSettings().getIndexVersionCreated().onOrAfter(Version.V_6_1_0)
+ && (context.fieldMapper(STRING_FIELD_NAME).omitNorms() == false)) {
assertThat(query, equalTo(new ConstantScoreQuery(new NormsFieldExistsQuery(STRING_FIELD_NAME))));
} else {
assertThat(query, equalTo(new ConstantScoreQuery(new TermQuery(new Term("_field_names", STRING_FIELD_NAME)))));
