update to support es5.0.0-beta1, Closes #282
This commit is contained in:
parent
f28ec3c3c2
commit
b6ec9c0a00
@ -11,7 +11,7 @@ Versions
|
||||
IK version | ES version
|
||||
-----------|-----------
|
||||
master | 5.x -> master
|
||||
5.0.0-alpha5 | 5.0.0-alpha5
|
||||
5.0.0-beta1 | 5.0.0-beta1
|
||||
1.9.5 | 2.3.5
|
||||
1.9.4 | 2.3.4
|
||||
1.9.3 | 2.3.3
|
||||
@ -241,7 +241,7 @@ Changes
|
||||
|
||||
*5.0.0*
|
||||
|
||||
- 移除名为 ik analyzer和tokenizer,请分别使用 ik_smart 和 ik_max_word
|
||||
- 移除名为 `ik` 的analyzer和tokenizer,请分别使用 `ik_smart` 和 `ik_max_word`
|
||||
|
||||
|
||||
Thanks
|
||||
|
10
pom.xml
10
pom.xml
@ -12,7 +12,7 @@
|
||||
<inceptionYear>2011</inceptionYear>
|
||||
|
||||
<properties>
|
||||
<elasticsearch.version>5.0.0-alpha5</elasticsearch.version>
|
||||
<elasticsearch.version>5.0.0-beta1</elasticsearch.version>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<elasticsearch.assembly.descriptor>${project.basedir}/src/main/assemblies/plugin.xml</elasticsearch.assembly.descriptor>
|
||||
<elasticsearch.plugin.name>analysis-ik</elasticsearch.plugin.name>
|
||||
@ -72,6 +72,7 @@
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
@ -79,10 +80,9 @@
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.17</version>
|
||||
<scope>runtime</scope>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-api</artifactId>
|
||||
<version>2.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@ -5,20 +5,13 @@ package org.wltea.analyzer.cfg;
|
||||
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.PathUtils;
|
||||
import org.elasticsearch.common.logging.ESLogger;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.plugin.analysis.ik.AnalysisIkPlugin;
|
||||
import org.wltea.analyzer.dic.Dictionary;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.URL;
|
||||
import java.io.File;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.InvalidPropertiesFormatException;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
public class Configuration {
|
||||
|
||||
|
@ -45,10 +45,11 @@ import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.elasticsearch.common.io.PathUtils;
|
||||
import org.elasticsearch.common.logging.ESLogger;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.logging.ESLoggerFactory;
|
||||
import org.elasticsearch.plugin.analysis.ik.AnalysisIkPlugin;
|
||||
import org.wltea.analyzer.cfg.Configuration;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
|
||||
/**
|
||||
* 词典管理类,单子模式
|
||||
@ -76,7 +77,8 @@ public class Dictionary {
|
||||
* 配置对象
|
||||
*/
|
||||
private Configuration configuration;
|
||||
public static ESLogger logger = Loggers.getLogger("ik-analyzer");
|
||||
|
||||
private static final Logger logger = ESLoggerFactory.getLogger(Monitor.class.getName());
|
||||
|
||||
private static ScheduledExecutorService pool = Executors.newScheduledThreadPool(1);
|
||||
|
||||
|
@ -7,12 +7,12 @@ import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpHead;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.elasticsearch.common.logging.ESLogger;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.common.logging.ESLoggerFactory;
|
||||
|
||||
public class Monitor implements Runnable {
|
||||
|
||||
public static ESLogger logger= Loggers.getLogger("ik-analyzer");
|
||||
private static final Logger logger = ESLoggerFactory.getLogger(Monitor.class.getName());
|
||||
|
||||
private static CloseableHttpClient httpclient = HttpClients.createDefault();
|
||||
/*
|
||||
@ -80,11 +80,11 @@ public class Monitor implements Runnable {
|
||||
//没有修改,不做操作
|
||||
//noop
|
||||
}else{
|
||||
Dictionary.logger.info("remote_ext_dict {} return bad code {}" , location , response.getStatusLine().getStatusCode() );
|
||||
logger.info("remote_ext_dict {} return bad code {}" , location , response.getStatusLine().getStatusCode() );
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
Dictionary.logger.error("remote_ext_dict {} error!",e , location);
|
||||
logger.error("remote_ext_dict {} error!",e , location);
|
||||
}finally{
|
||||
try {
|
||||
if (response != null) {
|
||||
@ -96,4 +96,4 @@ public class Monitor implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,11 @@
|
||||
package org.wltea.analyzer.help;
|
||||
|
||||
import org.elasticsearch.common.logging.ESLogger;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.common.logging.ESLoggerFactory;
|
||||
|
||||
public class Sleep {
|
||||
|
||||
public static ESLogger logger= Loggers.getLogger("ik-analyzer");
|
||||
private static final Logger logger = ESLoggerFactory.getLogger(Sleep.class.getName());
|
||||
|
||||
public enum Type{MSEC,SEC,MIN,HOUR};
|
||||
public static void sleep(Type type,int num){
|
||||
@ -33,4 +33,4 @@ public class Sleep {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user