diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 15e632f3d5..d0415a0286 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -9,6 +9,7 @@ + @@ -18,6 +19,7 @@ + @@ -58,7 +60,6 @@ - diff --git a/.idea/encodings.xml b/.idea/encodings.xml index e6f78746cb..d585052062 100644 --- a/.idea/encodings.xml +++ b/.idea/encodings.xml @@ -85,6 +85,8 @@ + + diff --git a/lucene/pom.xml b/lucene/pom.xml index 0f08abaee9..54faac61fc 100644 --- a/lucene/pom.xml +++ b/lucene/pom.xml @@ -9,9 +9,9 @@ An Apache Lucene demo application - com.baeldung + com.ossez parent-modules - 1.0.0-SNAPSHOT + 0.0.2-SNAPSHOT @@ -33,7 +33,7 @@ - 7.4.0 + 8.0.0 \ No newline at end of file diff --git a/lucene/src/main/java/com/baeldung/lucene/MyCustomAnalyzer.java b/lucene/src/main/java/com/baeldung/lucene/MyCustomAnalyzer.java index 609e2d09d3..097fde5e2e 100644 --- a/lucene/src/main/java/com/baeldung/lucene/MyCustomAnalyzer.java +++ b/lucene/src/main/java/com/baeldung/lucene/MyCustomAnalyzer.java @@ -4,10 +4,10 @@ import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.LowerCaseFilter; import org.apache.lucene.analysis.StopFilter; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.analysis.en.EnglishAnalyzer; import org.apache.lucene.analysis.en.PorterStemFilter; import org.apache.lucene.analysis.miscellaneous.CapitalizationFilter; -import org.apache.lucene.analysis.standard.StandardAnalyzer; -import org.apache.lucene.analysis.standard.StandardFilter; +import org.apache.lucene.analysis.standard.ClassicFilter; import org.apache.lucene.analysis.standard.StandardTokenizer; public class MyCustomAnalyzer extends Analyzer{ @@ -15,9 +15,9 @@ public class MyCustomAnalyzer extends Analyzer{ @Override protected TokenStreamComponents createComponents(String fieldName) { final StandardTokenizer src = new StandardTokenizer(); - TokenStream result = new StandardFilter(src); + TokenStream result = new ClassicFilter(src); result = new LowerCaseFilter(result); - result = new StopFilter(result, StandardAnalyzer.STOP_WORDS_SET); + result = new StopFilter(result, EnglishAnalyzer.ENGLISH_STOP_WORDS_SET); result = new PorterStemFilter(result); result = new CapitalizationFilter(result); return new TokenStreamComponents(src, result); diff --git a/lucene/src/test/java/com/baeldung/lucene/LuceneAnalyzerIntegrationTest.java b/lucene/src/test/java/com/baeldung/lucene/LuceneAnalyzerIntegrationTest.java index 28a87bba8c..3e4273d4bf 100644 --- a/lucene/src/test/java/com/baeldung/lucene/LuceneAnalyzerIntegrationTest.java +++ b/lucene/src/test/java/com/baeldung/lucene/LuceneAnalyzerIntegrationTest.java @@ -42,7 +42,7 @@ public class LuceneAnalyzerIntegrationTest { @Test public void whenUseStopAnalyzer_thenAnalyzed() throws IOException { - List result = analyze(SAMPLE_TEXT, new StopAnalyzer()); + List result = analyze(SAMPLE_TEXT, new StopAnalyzer(EnglishAnalyzer.ENGLISH_STOP_WORDS_SET)); assertThat(result, contains("baeldung", "com", "lucene", "analyzers", "test")); } diff --git a/pom.xml b/pom.xml index deea60dd64..57bbdd94c7 100644 --- a/pom.xml +++ b/pom.xml @@ -42,9 +42,11 @@ apache core-java-modules ethereum + image-compressing image-processing libraries-jackson + lucene parent-boot-2 @@ -52,7 +54,7 @@ persistence-modules testing-modules toolkits - + xml