Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

for Elasticsearch 7.17.1 #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.codelibs</groupId>
<artifactId>elasticsearch-analysis-kuromoji-ipadic-neologd</artifactId>
<version>7.2.1-SNAPSHOT</version>
<version>7.17.1-SNAPSHOT</version>
<packaging>jar</packaging>
<description>This plugin provides an analysis library for Kuromoji with UniDic and Neologd.</description>
<inceptionYear>2011</inceptionYear>
Expand All @@ -26,30 +26,30 @@
<version>9</version>
</parent>
<properties>
<elasticsearch.version>7.2.1</elasticsearch.version>
<elasticsearch.version>7.17.1</elasticsearch.version>
<elasticsearch.plugin.classname>org.codelibs.elasticsearch.kuromoji.ipadic.neologd.KuromojiNeologdPlugin</elasticsearch.plugin.classname>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<lucene.version>8.0.0</lucene.version>
<kuromoji-ipadic-neologd.version>20190808</kuromoji-ipadic-neologd.version>
<lucene.version>8.11.1</lucene.version>
<kuromoji-ipadic-neologd.version>20200910</kuromoji-ipadic-neologd.version>
Comment on lines +33 to +34
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Thank you for your pr!
I also want to use this plugin in elasticsearch. I clone your branch but I found that I cannot get this part from maven.
maven reports that:

org.codelibs:lucene-analyzers-kuromoji-ipadic-neologd:jar:8.11.1-20200910 was not found in https://maven.codelibs.org/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of codelibs.org has elapsed or updates are forced

I also checked the maven repo and I found that there is no version for it..
https://maven.codelibs.org/org/codelibs/lucene-analyzers-kuromoji-ipadic-neologd/

Could you help to take a look?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@boqigao
Sorry for the late reply.
This kuromoji-ipadic-neologd is indeed not in maven repo, so I am using a locally generated version use this.

If you build it here with lucene version 8.11.1, it should generate a usable jar.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @r4-keisuke I build own es 7.17.1 version with locally kuromoji-ipadic-neologd

                <dependency>
                        <groupId>org.codelibs</groupId>
                        <artifactId>lucene-analyzers-kuromoji-ipadic-neologd</artifactId>
                        <version>8.11.1-20200910</version>
                        <scope>system</scope>
                        <systemPath>/path/to/jar_file/lucene-analyzers-kuromoji-ipadic-neologd-8.11.1-20200910.jar</systemPath>
                </dependency>

but when i install plugin in es show this error:

"stacktrace": ["java.lang.NoClassDefFoundError: org/apache/lucene/analysis/ja/JapaneseIterationMarkCharFilter",

how can i fix?

</properties>
<repositories>
<repository>
<id>codelibs.org</id>
<name>CodeLibs Repository</name>
<url>http://maven.codelibs.org/</url>
<url>https://maven.codelibs.org/</url>
</repository>
<repository>
<name>oss.sonatype.org</name>
<id>oss.sonatype.org</id>
<url>http://oss.sonatype.org/content/groups/public/</url>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.10.1</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
Expand All @@ -66,7 +66,7 @@
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.1.0</version>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -78,7 +78,7 @@
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.1</version>
<version>3.4.2</version>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<outputDirectory>${project.build.directory}/releases/</outputDirectory>
Expand Down Expand Up @@ -112,7 +112,7 @@
<dependency>
<groupId>org.codelibs</groupId>
<artifactId>analyzers</artifactId>
<version>8.0.0.0</version>
<version>8.11.1.0</version>
</dependency>
<dependency>
<groupId>org.codelibs</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
import java.util.Set;

import org.apache.lucene.analysis.CharArraySet;
import org.codelibs.neologd.ipadic.lucene.analysis.ja.JapaneseAnalyzer;
import org.codelibs.neologd.ipadic.lucene.analysis.ja.JapaneseTokenizer;
import org.codelibs.neologd.ipadic.lucene.analysis.ja.dict.UserDictionary;
import org.apache.lucene.analysis.ja.JapaneseAnalyzer;
import org.apache.lucene.analysis.ja.JapaneseTokenizer;
import org.apache.lucene.analysis.ja.dict.UserDictionary;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.env.Environment;
import org.elasticsearch.index.IndexSettings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package org.codelibs.elasticsearch.kuromoji.ipadic.neologd.index.analysis;

import org.apache.lucene.analysis.TokenStream;
import org.codelibs.neologd.ipadic.lucene.analysis.ja.JapaneseBaseFormFilter;
import org.apache.lucene.analysis.ja.JapaneseBaseFormFilter;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.env.Environment;
import org.elasticsearch.index.IndexSettings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import java.io.Reader;

import org.codelibs.neologd.ipadic.lucene.analysis.ja.JapaneseIterationMarkCharFilter;
import org.apache.lucene.analysis.ja.JapaneseIterationMarkCharFilter;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.env.Environment;
import org.elasticsearch.index.IndexSettings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package org.codelibs.elasticsearch.kuromoji.ipadic.neologd.index.analysis;

import org.apache.lucene.analysis.TokenStream;
import org.codelibs.neologd.ipadic.lucene.analysis.ja.JapaneseKatakanaStemFilter;
import org.apache.lucene.analysis.ja.JapaneseKatakanaStemFilter;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.env.Environment;
import org.elasticsearch.index.IndexSettings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package org.codelibs.elasticsearch.kuromoji.ipadic.neologd.index.analysis;

import org.apache.lucene.analysis.TokenStream;
import org.codelibs.neologd.ipadic.lucene.analysis.ja.JapaneseNumberFilter;
import org.apache.lucene.analysis.ja.JapaneseNumberFilter;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.env.Environment;
import org.elasticsearch.index.IndexSettings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
import java.util.Set;

import org.apache.lucene.analysis.TokenStream;
import org.codelibs.neologd.ipadic.lucene.analysis.ja.JapaneseAnalyzer;
import org.codelibs.neologd.ipadic.lucene.analysis.ja.JapanesePartOfSpeechStopFilter;
import org.apache.lucene.analysis.ja.JapaneseAnalyzer;
import org.apache.lucene.analysis.ja.JapanesePartOfSpeechStopFilter;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.env.Environment;
import org.elasticsearch.index.IndexSettings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package org.codelibs.elasticsearch.kuromoji.ipadic.neologd.index.analysis;

import org.apache.lucene.analysis.TokenStream;
import org.codelibs.neologd.ipadic.lucene.analysis.ja.JapaneseReadingFormFilter;
import org.apache.lucene.analysis.ja.JapaneseReadingFormFilter;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.env.Environment;
import org.elasticsearch.index.IndexSettings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
import java.io.Reader;

import org.apache.lucene.analysis.Tokenizer;
import org.codelibs.neologd.ipadic.lucene.analysis.ja.JapaneseTokenizer;
import org.codelibs.neologd.ipadic.lucene.analysis.ja.JapaneseTokenizer.Mode;
import org.codelibs.neologd.ipadic.lucene.analysis.ja.dict.UserDictionary;
import org.apache.lucene.analysis.ja.JapaneseTokenizer;
import org.apache.lucene.analysis.ja.JapaneseTokenizer.Mode;
import org.apache.lucene.analysis.ja.dict.UserDictionary;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.env.Environment;
Expand All @@ -47,7 +47,7 @@ public class KuromojiTokenizerFactory extends AbstractTokenizerFactory {
private boolean discartPunctuation;

public KuromojiTokenizerFactory(IndexSettings indexSettings, Environment env, String name, Settings settings) {
super(indexSettings, settings);
super(indexSettings, settings, name);
mode = getMode(settings);
userDictionary = getUserDictionary(env, settings);
discartPunctuation = settings.getAsBoolean("discard_punctuation", true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.apache.lucene.analysis.TokenStream;
import org.codelibs.analysis.ja.PosConcatenationFilter;
import org.codelibs.analysis.ja.PosConcatenationFilter.PartOfSpeechSupplier;
import org.codelibs.neologd.ipadic.lucene.analysis.ja.tokenattributes.PartOfSpeechAttribute;
import org.apache.lucene.analysis.ja.tokenattributes.PartOfSpeechAttribute;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.env.Environment;
import org.elasticsearch.index.IndexSettings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.Settings.Builder;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.xcontent.XContentBuilder;
import org.elasticsearch.xcontent.XContentFactory;
import org.elasticsearch.xcontent.XContentType;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.node.Node;
import org.elasticsearch.rest.RestStatus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.codelibs.elasticsearch.runner.net.EcrCurl;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.Settings.Builder;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.xcontent.XContentType;
import org.elasticsearch.node.Node;
import org.junit.After;
import org.junit.Before;
Expand All @@ -43,8 +43,8 @@ public void setUp() throws Exception {
public void build(final int number, final Builder settingsBuilder) {
settingsBuilder.put("http.cors.enabled", true);
settingsBuilder.put("http.cors.allow-origin", "*");
settingsBuilder.putList("discovery.seed_hosts", "127.0.0.1:9301");
settingsBuilder.putList("cluster.initial_master_nodes", "127.0.0.1:9301");
settingsBuilder.putList("discovery.seed_hosts", "127.0.0.1:9300");
settingsBuilder.putList("cluster.initial_master_nodes", "127.0.0.1:9300");
}
}).build(newConfigs().clusterName(clusterName).numOfNode(numOfNode).pluginTypes("org.codelibs.elasticsearch.kuromoji.ipadic.neologd.KuromojiNeologdPlugin"));

Expand Down