diff --git a/plugins/analysis-kuromoji/src/main/java/org/opensearch/index/analysis/KuromojiCompletionFilterFactory.java b/plugins/analysis-kuromoji/src/main/java/org/opensearch/index/analysis/KuromojiCompletionFilterFactory.java index 3c6a1132b1e9b..1459c19de46db 100644 --- a/plugins/analysis-kuromoji/src/main/java/org/opensearch/index/analysis/KuromojiCompletionFilterFactory.java +++ b/plugins/analysis-kuromoji/src/main/java/org/opensearch/index/analysis/KuromojiCompletionFilterFactory.java @@ -25,11 +25,14 @@ public KuromojiCompletionFilterFactory(IndexSettings indexSettings, Environment public static Mode getMode(Settings settings) { String modeSetting = settings.get("mode", null); - if (modeSetting == null || "index".equalsIgnoreCase(modeSetting)) { - return Mode.INDEX; - } else { - return Mode.QUERY; + if (modeSetting != null) { + if ("index".equalsIgnoreCase(modeSetting)) { + return Mode.INDEX; + } else if ("query".equalsIgnoreCase(modeSetting)) { + return Mode.QUERY; + } } + return Mode.INDEX; } @Override