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

This commit is contained in:
Tomoko Uchida 2021-11-28 21:22:28 +09:00 committed by GitHub
parent c041517304
commit cb5f1b6ca0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 5 deletions

View File

@ -41,6 +41,7 @@ import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.Tokenizer;
import org.apache.lucene.analysis.TokenizerFactory; import org.apache.lucene.analysis.TokenizerFactory;
import org.apache.lucene.analysis.custom.CustomAnalyzer; 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.analysis.tokenattributes.CharTermAttribute;
import org.apache.lucene.luke.models.LukeException; import org.apache.lucene.luke.models.LukeException;
import org.apache.lucene.util.AttributeImpl; import org.apache.lucene.util.AttributeImpl;
@ -153,11 +154,7 @@ public final class AnalysisImpl implements Analysis {
} }
private Analyzer defaultAnalyzer() { private Analyzer defaultAnalyzer() {
try { return new StandardAnalyzer();
return CustomAnalyzer.builder().withTokenizer("standard").build();
} catch (IOException e) {
throw new LukeException("Failed to build custom analyzer.", e);
}
} }
@Override @Override