Skip to content

Apache Lucene open-source search software

Use the same analysis chain to StandardAnalyzer (a follow-up of #480) (#482)

Tomoko Uchidacb5f1b6ca0cc
diff --git a/lucene/luke/src/java/org/apache/lucene/luke/models/analysis/AnalysisImpl.java b/lucene/luke/src/java/org/apache/lucene/luke/models/analysis/AnalysisImpl.java
index e68383c507e..fb3a065cbb2 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/models/analysis/AnalysisImpl.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/models/analysis/AnalysisImpl.java
@@ -41,6 +41,7 @@ import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.Tokenizer;
import org.apache.lucene.analysis.TokenizerFactory;
import org.apache.lucene.analysis.custom.CustomAnalyzer;
+import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
import org.apache.lucene.luke.models.LukeException;
import org.apache.lucene.util.AttributeImpl;
@@ -153,11 +154,7 @@ public final class AnalysisImpl implements Analysis {
}
private Analyzer defaultAnalyzer() {
- try {
- return CustomAnalyzer.builder().withTokenizer("standard").build();
- } catch (IOException e) {
- throw new LukeException("Failed to build custom analyzer.", e);
- }
+ return new StandardAnalyzer();
}
@Override