From ceaa93cc0ac2011a99a3dcf0640981cb5ea04ffe Mon Sep 17 00:00:00 2001 From: "Christian F." Date: Sat, 2 Nov 2024 09:54:48 +0100 Subject: [PATCH] - do not use SPI for Lucene Tokenizer and Filters --- src/main/java/mediathek/tool/LuceneDefaultAnalyzer.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/mediathek/tool/LuceneDefaultAnalyzer.java b/src/main/java/mediathek/tool/LuceneDefaultAnalyzer.java index f5eebffa0..f0ddd638a 100644 --- a/src/main/java/mediathek/tool/LuceneDefaultAnalyzer.java +++ b/src/main/java/mediathek/tool/LuceneDefaultAnalyzer.java @@ -21,6 +21,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.lucene.analysis.Analyzer; +import org.apache.lucene.analysis.core.LowerCaseFilterFactory; +import org.apache.lucene.analysis.core.WhitespaceTokenizerFactory; import org.apache.lucene.analysis.custom.CustomAnalyzer; import org.apache.lucene.analysis.standard.StandardAnalyzer; @@ -34,8 +36,8 @@ public static Analyzer buildAnalyzer() { Analyzer analyzer; try { analyzer = CustomAnalyzer.builder() - .withTokenizer("whitespace") - .addTokenFilter("lowercase") + .withTokenizer(WhitespaceTokenizerFactory.class) + .addTokenFilter(LowerCaseFilterFactory.class) .build(); } catch (IOException e) {