From 5c19ae10a931fa6740af57510e762857cd1e22a8 Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Fri, 25 Apr 2025 14:35:33 -0400 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20lucene=20=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/compiler.xml | 3 ++- .idea/encodings.xml | 2 ++ lucene/pom.xml | 4 ++-- pom.xml | 4 +++- 4 files changed, 9 insertions(+), 4 deletions(-) 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..fc457fe19a 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 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 From f50bccce9db710a0636bc2ac1e6086aae8a90e17 Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Fri, 25 Apr 2025 14:37:26 -0400 Subject: [PATCH 2/3] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=8C=85=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E7=9A=84=E5=86=B2=E7=AA=81=EF=BC=8C=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E5=88=B0=207.73=20=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lucene/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lucene/pom.xml b/lucene/pom.xml index fc457fe19a..e5c0d0b6c7 100644 --- a/lucene/pom.xml +++ b/lucene/pom.xml @@ -33,7 +33,7 @@ - 7.4.0 + 7.7.3 \ No newline at end of file From 8cba34008b3551a86c0432f3f9b771bdcaad51c7 Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Fri, 25 Apr 2025 15:42:30 -0400 Subject: [PATCH 3/3] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=8C=85=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E7=9A=84=E5=86=B2=E7=AA=81=EF=BC=8C=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E5=88=B0=208.0.0=20=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lucene/pom.xml | 2 +- .../main/java/com/baeldung/lucene/MyCustomAnalyzer.java | 8 ++++---- .../baeldung/lucene/LuceneAnalyzerIntegrationTest.java | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lucene/pom.xml b/lucene/pom.xml index e5c0d0b6c7..54faac61fc 100644 --- a/lucene/pom.xml +++ b/lucene/pom.xml @@ -33,7 +33,7 @@ - 7.7.3 + 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")); }