[TEST] Add mapping to use an actual stopword analyzer

This test was added when the default  analyzer was filtering stopwords. But since
1.0 the default analyzer doesn't filter stopwords
This commit is contained in:
Simon Willnauer 2014-03-13 20:32:12 +01:00
parent 2e56253293
commit 10a1fcb65a
1 changed files with 5 additions and 2 deletions

View File

@ -410,9 +410,12 @@ public class SuggestSearchTests extends ElasticsearchIntegrationTest {
@Test // see #2817 @Test // see #2817
public void testStopwordsOnlyPhraseSuggest() throws ElasticsearchException, IOException { public void testStopwordsOnlyPhraseSuggest() throws ElasticsearchException, IOException {
createIndex("test"); assertAcked(prepareCreate("test").addMapping("typ1", "body", "type=string,analyzer=stopwd").setSettings(
settingsBuilder()
.put("index.analysis.analyzer.stopwd.tokenizer", "whitespace")
.putArray("index.analysis.analyzer.stopwd.filter", "stop")
));
ensureGreen(); ensureGreen();
index("test", "typ1", "1", "body", "this is a test"); index("test", "typ1", "1", "body", "this is a test");
refresh(); refresh();