Skip to content

Commit

Permalink
Add test stempel analyzer in mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
dadoonet committed Feb 17, 2014
1 parent 674491d commit 6ce7e89
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -50,4 +53,25 @@ public void testPolishStemmerTokenFilter() throws ExecutionException, Interrupte
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();
}

}

0 comments on commit 6ce7e89

Please sign in to comment.