From 6ce7e897d8794f6fb5ec614f44d4a44a357fe16c Mon Sep 17 00:00:00 2001 From: David Pilato Date: Mon, 17 Feb 2014 15:21:24 +0100 Subject: [PATCH] Add test stempel analyzer in mapping --- .../SimplePolishIntegrationTests.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/test/java/org/elasticsearch/index/analysis/SimplePolishIntegrationTests.java b/src/test/java/org/elasticsearch/index/analysis/SimplePolishIntegrationTests.java index d30b353fc6b..50c11667762 100644 --- a/src/test/java/org/elasticsearch/index/analysis/SimplePolishIntegrationTests.java +++ b/src/test/java/org/elasticsearch/index/analysis/SimplePolishIntegrationTests.java @@ -20,11 +20,14 @@ package org.elasticsearch.index.analysis; import org.elasticsearch.action.admin.indices.analyze.AnalyzeResponse; +import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.test.ElasticsearchIntegrationTest; import org.junit.Test; +import java.io.IOException; import java.util.concurrent.ExecutionException; +import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.notNullValue; @@ -50,4 +53,25 @@ public class SimplePolishIntegrationTests extends ElasticsearchIntegrationTest { assertThat(response, notNullValue()); assertThat(response.getTokens().size(), is(1)); } + + @Test + public void testPolishAnalyzerInMapping() throws ExecutionException, InterruptedException, IOException { + final XContentBuilder mapping = jsonBuilder().startObject() + .startObject("type") + .startObject("properties") + .startObject("foo") + .field("type", "string") + .field("analyzer", "polish") + .endObject() + .endObject() + .endObject() + .endObject(); + + client().admin().indices().prepareCreate("test").addMapping("type", mapping).get(); + + index("test", "type", "1", "foo", "wirtualna polska"); + + ensureYellow(); + } + }