From b5a80db915e9035ed2c1f9d0b0164d194702ff02 Mon Sep 17 00:00:00 2001 From: sweetest Date: Sat, 10 Jan 2015 12:38:32 +0900 Subject: [PATCH] [#9053] introduce index option named 'index.percolator.map_unmapped_field_as_string --- .../percolator/PercolatorBackwardsCompatibilityTests.java | 4 +--- .../java/org/elasticsearch/percolator/PercolatorTests.java | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/org/elasticsearch/percolator/PercolatorBackwardsCompatibilityTests.java b/src/test/java/org/elasticsearch/percolator/PercolatorBackwardsCompatibilityTests.java index f61bfb8c4bcf0..4c2cfcf487e91 100644 --- a/src/test/java/org/elasticsearch/percolator/PercolatorBackwardsCompatibilityTests.java +++ b/src/test/java/org/elasticsearch/percolator/PercolatorBackwardsCompatibilityTests.java @@ -22,18 +22,15 @@ import org.elasticsearch.action.index.IndexRequestBuilder; import org.elasticsearch.action.percolate.PercolateResponse; import org.elasticsearch.action.percolate.PercolateSourceBuilder; -import org.elasticsearch.common.settings.ImmutableSettings; import org.elasticsearch.index.percolator.PercolatorException; import org.elasticsearch.index.query.QueryParsingException; import org.elasticsearch.test.ElasticsearchIntegrationTest; import org.junit.Test; -import static org.elasticsearch.action.percolate.PercolateSourceBuilder.docBuilder; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.termQuery; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertMatchCount; -import static org.hamcrest.Matchers.arrayWithSize; import static org.hamcrest.Matchers.instanceOf; /** @@ -73,4 +70,5 @@ public void testPercolatorUpgrading() throws Exception { assertThat(e.getRootCause(), instanceOf(QueryParsingException.class)); } } + } diff --git a/src/test/java/org/elasticsearch/percolator/PercolatorTests.java b/src/test/java/org/elasticsearch/percolator/PercolatorTests.java index f325d04c784d7..9a69a0dc9a86f 100644 --- a/src/test/java/org/elasticsearch/percolator/PercolatorTests.java +++ b/src/test/java/org/elasticsearch/percolator/PercolatorTests.java @@ -2039,7 +2039,7 @@ public void testMapUnmappedFieldAsString() throws IOException{ assertAcked(prepareCreate("test") .setSettings(settings)); client().prepareIndex("test", PercolatorService.TYPE_NAME) - .setSource(jsonBuilder().startObject().field("query", queryStringQuery("VALUE")).endObject()).get(); + .setSource(jsonBuilder().startObject().field("query", matchQuery("field1", "value")).endObject()).get(); logger.info("--> Percolate doc with field1=value"); PercolateResponse response1 = client().preparePercolate() .setIndices("test").setDocumentType("type")