From 7beb39ded641972d3fe9186fdb568c4445cf9a8f Mon Sep 17 00:00:00 2001 From: Alexander Zagniotov Date: Mon, 12 Feb 2024 09:51:22 -0800 Subject: [PATCH] Solr v9.4.x compatibility (#80) --- gradle.properties | 4 ++-- .../ja/sudachi/attributes/SudachiAttributeImpl.java | 7 ++++++- .../sudachi/attributes/SudachiMorphemeAttributeImpl.java | 3 ++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index fa5d203..deaf22f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,8 +3,8 @@ solrLuceneAnalyzerSudachiProjectGroup=io.github.azagniotov solrLuceneAnalyzerSudachiProjectVersion=1.0.0-SNAPSHOT sudachiVersion=0.7.3 -solrVersion=9.3.0 -luceneVersion=9.7.0 +solrVersion=9.4.0 +luceneVersion=9.8.0 slf4jVersion=1.7.36 log4j2Version=2.19.0 diff --git a/src/main/java/io/github/azagniotov/lucene/analysis/ja/sudachi/attributes/SudachiAttributeImpl.java b/src/main/java/io/github/azagniotov/lucene/analysis/ja/sudachi/attributes/SudachiAttributeImpl.java index e29c878..c733c68 100644 --- a/src/main/java/io/github/azagniotov/lucene/analysis/ja/sudachi/attributes/SudachiAttributeImpl.java +++ b/src/main/java/io/github/azagniotov/lucene/analysis/ja/sudachi/attributes/SudachiAttributeImpl.java @@ -41,7 +41,12 @@ public void clear() { @Override public void reflectWith(AttributeReflector attributeReflector) { - attributeReflector.reflect(SudachiAttribute.class, "dictionary", getDictionary()); + // AttributeReflector is used by Solr and Elasticsearch to provide analysis output. + // + // The following code: + // attributeReflector.reflect(SudachiAttribute.class, "dictionary", getDictionary()); + // + // is commented out because we do not need to reflect on the Dictionary, it is not needed for the above. } @Override diff --git a/src/main/java/io/github/azagniotov/lucene/analysis/ja/sudachi/attributes/SudachiMorphemeAttributeImpl.java b/src/main/java/io/github/azagniotov/lucene/analysis/ja/sudachi/attributes/SudachiMorphemeAttributeImpl.java index 94e4d8b..1258cd7 100644 --- a/src/main/java/io/github/azagniotov/lucene/analysis/ja/sudachi/attributes/SudachiMorphemeAttributeImpl.java +++ b/src/main/java/io/github/azagniotov/lucene/analysis/ja/sudachi/attributes/SudachiMorphemeAttributeImpl.java @@ -43,9 +43,10 @@ public void clear() { public void reflectWith(AttributeReflector attributeReflector) { // AttributeReflector is used by Solr and Elasticsearch to provide analysis output. // - // The following code is commented out because of: + // The following code: // attributeReflector.reflect(SudachiMorphemeAttribute.class, "morpheme", getMorpheme()); // + // is commented out because of: // 1. We do not need to reflect on Morpheme object implementation, it is not needed for the above. // 2. The com.worksap.nlp.sudachi.MorphemeImpl has package default visibility. Solr throws because of that: // Caused by: java.lang.IllegalAccessException: access violation: class com.worksap.nlp.sudachi.MorphemeImpl,