From 10a1fcb65a6746deb29776e11079be2b2c8f1ca8 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Thu, 13 Mar 2014 20:32:12 +0100 Subject: [PATCH] [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 --- .../elasticsearch/search/suggest/SuggestSearchTests.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/elasticsearch/search/suggest/SuggestSearchTests.java b/src/test/java/org/elasticsearch/search/suggest/SuggestSearchTests.java index 7a82b85adfb..398f0f8d745 100644 --- a/src/test/java/org/elasticsearch/search/suggest/SuggestSearchTests.java +++ b/src/test/java/org/elasticsearch/search/suggest/SuggestSearchTests.java @@ -410,9 +410,12 @@ public class SuggestSearchTests extends ElasticsearchIntegrationTest { @Test // see #2817 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(); - index("test", "typ1", "1", "body", "this is a test"); refresh();