Skip to content

Commit bf423ad

Browse files
authored
modified: elasticsearch/pom.xml (#1096)
modified: elasticsearch/src/main/java/com/infinilabs/ik/elasticsearch/IkAnalyzerProvider.java modified: elasticsearch/src/main/java/com/infinilabs/ik/elasticsearch/IkTokenizerFactory.java modified: pom.xml
1 parent b09264c commit bf423ad

File tree

4 files changed

+120
-116
lines changed

4 files changed

+120
-116
lines changed

elasticsearch/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<parent>
66
<artifactId>analysis-ik</artifactId>
77
<groupId>com.infinilabs</groupId>
@@ -60,4 +60,4 @@
6060
</plugin>
6161
</plugins>
6262
</build>
63-
</project>
63+
</project>

elasticsearch/src/main/java/com/infinilabs/ik/elasticsearch/IkAnalyzerProvider.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,22 @@
1010
public class IkAnalyzerProvider extends AbstractIndexAnalyzerProvider<IKAnalyzer> {
1111
private final IKAnalyzer analyzer;
1212

13-
public IkAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings,boolean useSmart) {
14-
super(name, settings);
15-
16-
Configuration configuration = new ConfigurationSub(env,settings).setUseSmart(useSmart);
17-
18-
analyzer=new IKAnalyzer(configuration);
13+
public IkAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings, boolean useSmart) {
14+
super(name);
15+
Configuration configuration = new ConfigurationSub(env, settings).setUseSmart(useSmart);
16+
analyzer = new IKAnalyzer(configuration);
1917
}
2018

2119
public static IkAnalyzerProvider getIkSmartAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
22-
return new IkAnalyzerProvider(indexSettings,env,name,settings,true);
20+
return new IkAnalyzerProvider(indexSettings, env, name, settings, true);
2321
}
2422

2523
public static IkAnalyzerProvider getIkAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
26-
return new IkAnalyzerProvider(indexSettings,env,name,settings,false);
24+
return new IkAnalyzerProvider(indexSettings, env, name, settings, false);
2725
}
2826

29-
@Override public IKAnalyzer get() {
27+
@Override
28+
public IKAnalyzer get() {
3029
return this.analyzer;
3130
}
3231
}

elasticsearch/src/main/java/com/infinilabs/ik/elasticsearch/IkTokenizerFactory.java

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,28 @@
99
import org.wltea.analyzer.lucene.IKTokenizer;
1010

1111
public class IkTokenizerFactory extends AbstractTokenizerFactory {
12-
private Configuration configuration;
12+
private Configuration configuration;
1313

14-
public IkTokenizerFactory(IndexSettings indexSettings, Environment env, String name, Settings settings) {
15-
super(indexSettings, settings,name);
16-
configuration = new ConfigurationSub(env,settings);
17-
}
14+
public IkTokenizerFactory(IndexSettings indexSettings, Environment env, String name, Settings settings) {
15+
super(name);
16+
configuration = new ConfigurationSub(env, settings);
17+
}
1818

19-
public static IkTokenizerFactory getIkTokenizerFactory(IndexSettings indexSettings, Environment env, String name, Settings settings) {
20-
return new IkTokenizerFactory(indexSettings,env, name, settings).setSmart(false);
21-
}
19+
public static IkTokenizerFactory getIkTokenizerFactory(IndexSettings indexSettings, Environment env, String name, Settings settings) {
20+
return new IkTokenizerFactory(indexSettings, env, name, settings).setSmart(false);
21+
}
2222

23-
public static IkTokenizerFactory getIkSmartTokenizerFactory(IndexSettings indexSettings, Environment env, String name, Settings settings) {
24-
return new IkTokenizerFactory(indexSettings,env, name, settings).setSmart(true);
25-
}
23+
public static IkTokenizerFactory getIkSmartTokenizerFactory(IndexSettings indexSettings, Environment env, String name, Settings settings) {
24+
return new IkTokenizerFactory(indexSettings, env, name, settings).setSmart(true);
25+
}
2626

27-
public IkTokenizerFactory setSmart(boolean smart){
27+
public IkTokenizerFactory setSmart(boolean smart) {
2828
this.configuration.setUseSmart(smart);
2929
return this;
30-
}
30+
}
3131

32-
@Override
33-
public Tokenizer create() {
34-
return new IKTokenizer(configuration); }
32+
@Override
33+
public Tokenizer create() {
34+
return new IKTokenizer(configuration);
35+
}
3536
}

pom.xml

Lines changed: 92 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<name>analysis-ik</name>
6-
<modules>
6+
<modules>
77
<module>core</module>
88
<module>elasticsearch</module>
99
<module>opensearch</module>
10-
</modules>
11-
10+
</modules>
11+
1212
<modelVersion>4.0.0</modelVersion>
1313
<groupId>com.infinilabs</groupId>
1414
<artifactId>analysis-ik</artifactId>
@@ -18,10 +18,10 @@
1818

1919
<properties>
2020
<lucene.version>9.3.0</lucene.version>
21-
<elasticsearch.version>8.18.0</elasticsearch.version>
21+
<elasticsearch.version>9.0.0</elasticsearch.version>
2222
<opensearch.version>2.0.1</opensearch.version>
2323
<maven.compiler.target>1.8</maven.compiler.target>
24-
24+
2525
<tests.rest.load_packaged>false</tests.rest.load_packaged>
2626
<skip.unit.tests>true</skip.unit.tests>
2727
<gpg.keyname>4E899B30</gpg.keyname>
@@ -73,8 +73,12 @@
7373
<repository>
7474
<id>oss.sonatype.org</id>
7575
<name>OSS Sonatype</name>
76-
<releases><enabled>true</enabled></releases>
77-
<snapshots><enabled>true</enabled></snapshots>
76+
<releases>
77+
<enabled>true</enabled>
78+
</releases>
79+
<snapshots>
80+
<enabled>true</enabled>
81+
</snapshots>
7882
<url>https://oss.sonatype.org/content/repositories/releases/</url>
7983
</repository>
8084
</repositories>
@@ -128,83 +132,83 @@
128132
<additionalparam>-Xdoclint:none</additionalparam>
129133
</properties>
130134
</profile>
131-
<profile>
132-
<id>release</id>
133-
<build>
134-
<plugins>
135-
<plugin>
136-
<groupId>org.sonatype.plugins</groupId>
137-
<artifactId>nexus-staging-maven-plugin</artifactId>
138-
<version>1.6.3</version>
139-
<extensions>true</extensions>
140-
<configuration>
141-
<serverId>oss</serverId>
142-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
143-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
144-
</configuration>
145-
</plugin>
146-
<plugin>
147-
<groupId>org.apache.maven.plugins</groupId>
148-
<artifactId>maven-release-plugin</artifactId>
149-
<version>2.1</version>
150-
<configuration>
151-
<autoVersionSubmodules>true</autoVersionSubmodules>
152-
<useReleaseProfile>false</useReleaseProfile>
153-
<releaseProfiles>release</releaseProfiles>
154-
<goals>deploy</goals>
155-
</configuration>
156-
</plugin>
157-
<plugin>
158-
<groupId>org.apache.maven.plugins</groupId>
159-
<artifactId>maven-compiler-plugin</artifactId>
160-
<version>3.5.1</version>
161-
<configuration>
162-
<source>${maven.compiler.target}</source>
163-
<target>${maven.compiler.target}</target>
164-
</configuration>
165-
</plugin>
166-
<plugin>
167-
<groupId>org.apache.maven.plugins</groupId>
168-
<artifactId>maven-gpg-plugin</artifactId>
169-
<version>1.5</version>
170-
<executions>
171-
<execution>
172-
<id>sign-artifacts</id>
173-
<phase>verify</phase>
174-
<goals>
175-
<goal>sign</goal>
176-
</goals>
177-
</execution>
178-
</executions>
179-
</plugin>
180-
<plugin>
181-
<groupId>org.apache.maven.plugins</groupId>
182-
<artifactId>maven-source-plugin</artifactId>
183-
<version>2.2.1</version>
184-
<executions>
185-
<execution>
186-
<id>attach-sources</id>
187-
<goals>
188-
<goal>jar-no-fork</goal>
189-
</goals>
190-
</execution>
191-
</executions>
192-
</plugin>
193-
<plugin>
194-
<groupId>org.apache.maven.plugins</groupId>
195-
<artifactId>maven-javadoc-plugin</artifactId>
196-
<version>2.9</version>
197-
<executions>
198-
<execution>
199-
<id>attach-javadocs</id>
200-
<goals>
201-
<goal>jar</goal>
202-
</goals>
203-
</execution>
204-
</executions>
205-
</plugin>
206-
</plugins>
207-
</build>
208-
</profile>
135+
<profile>
136+
<id>release</id>
137+
<build>
138+
<plugins>
139+
<plugin>
140+
<groupId>org.sonatype.plugins</groupId>
141+
<artifactId>nexus-staging-maven-plugin</artifactId>
142+
<version>1.6.3</version>
143+
<extensions>true</extensions>
144+
<configuration>
145+
<serverId>oss</serverId>
146+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
147+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
148+
</configuration>
149+
</plugin>
150+
<plugin>
151+
<groupId>org.apache.maven.plugins</groupId>
152+
<artifactId>maven-release-plugin</artifactId>
153+
<version>2.1</version>
154+
<configuration>
155+
<autoVersionSubmodules>true</autoVersionSubmodules>
156+
<useReleaseProfile>false</useReleaseProfile>
157+
<releaseProfiles>release</releaseProfiles>
158+
<goals>deploy</goals>
159+
</configuration>
160+
</plugin>
161+
<plugin>
162+
<groupId>org.apache.maven.plugins</groupId>
163+
<artifactId>maven-compiler-plugin</artifactId>
164+
<version>3.5.1</version>
165+
<configuration>
166+
<source>${maven.compiler.target}</source>
167+
<target>${maven.compiler.target}</target>
168+
</configuration>
169+
</plugin>
170+
<plugin>
171+
<groupId>org.apache.maven.plugins</groupId>
172+
<artifactId>maven-gpg-plugin</artifactId>
173+
<version>1.5</version>
174+
<executions>
175+
<execution>
176+
<id>sign-artifacts</id>
177+
<phase>verify</phase>
178+
<goals>
179+
<goal>sign</goal>
180+
</goals>
181+
</execution>
182+
</executions>
183+
</plugin>
184+
<plugin>
185+
<groupId>org.apache.maven.plugins</groupId>
186+
<artifactId>maven-source-plugin</artifactId>
187+
<version>2.2.1</version>
188+
<executions>
189+
<execution>
190+
<id>attach-sources</id>
191+
<goals>
192+
<goal>jar-no-fork</goal>
193+
</goals>
194+
</execution>
195+
</executions>
196+
</plugin>
197+
<plugin>
198+
<groupId>org.apache.maven.plugins</groupId>
199+
<artifactId>maven-javadoc-plugin</artifactId>
200+
<version>2.9</version>
201+
<executions>
202+
<execution>
203+
<id>attach-javadocs</id>
204+
<goals>
205+
<goal>jar</goal>
206+
</goals>
207+
</execution>
208+
</executions>
209+
</plugin>
210+
</plugins>
211+
</build>
212+
</profile>
209213
</profiles>
210-
</project>
214+
</project>

0 commit comments

Comments
 (0)