From e3fc6a0f7e5f4968926ef4362461d4a94e12909e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20B=C3=BCscher?= Date: Wed, 12 Aug 2015 23:50:20 +0200 Subject: [PATCH] Fix SimpleQueryStringBuilderTest, allow part of only with mapping --- .../index/query/SimpleQueryStringBuilderTest.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/core/src/test/java/org/elasticsearch/index/query/SimpleQueryStringBuilderTest.java b/core/src/test/java/org/elasticsearch/index/query/SimpleQueryStringBuilderTest.java index 99da823e84e..69fa2888fa1 100644 --- a/core/src/test/java/org/elasticsearch/index/query/SimpleQueryStringBuilderTest.java +++ b/core/src/test/java/org/elasticsearch/index/query/SimpleQueryStringBuilderTest.java @@ -24,6 +24,7 @@ import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; +import org.elasticsearch.Version; import org.elasticsearch.cluster.metadata.MetaData; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentParser; @@ -254,10 +255,16 @@ public class SimpleQueryStringBuilderTest extends BaseQueryTestCase 0 || shardContext.indexQueryParserService().getIndexCreatedVersion().before(Version.V_1_4_0_Beta1)) { + Query luceneQuery = queryBuilder.toQuery(shardContext); + assertThat(luceneQuery, instanceOf(TermQuery.class)); + TermQuery termQuery = (TermQuery) luceneQuery; + assertThat(termQuery.getTerm(), equalTo(new Term(MetaData.ALL, query))); + } } private static int shouldClauses(BooleanQuery query) {