Skip to content

Commit

Permalink
Fixes QueryStringQueryBuilderTests
Browse files Browse the repository at this point in the history
Closes #27246
  • Loading branch information
colings86 committed Nov 3, 2017
1 parent 9e67cca commit 20e8005
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,8 @@ public void testExistsFieldQuery() throws Exception {
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)))));
Expand Down

0 comments on commit 20e8005

Please sign in to comment.