Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
iiopsd
elasticsearch-analysis-ik
提交
e81fcaf7
E
elasticsearch-analysis-ik
项目概览
iiopsd
/
elasticsearch-analysis-ik
与 Fork 源项目一致
从无法访问的项目Fork
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
elasticsearch-analysis-ik
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e81fcaf7
编写于
9月 28, 2016
作者:
weixin_43283383
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update to support es5.0.0-beta1
上级
f28ec3c3
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
23 addition
and
28 deletion
+23
-28
README.md
README.md
+2
-2
pom.xml
pom.xml
+5
-5
src/main/java/org/wltea/analyzer/cfg/Configuration.java
src/main/java/org/wltea/analyzer/cfg/Configuration.java
+1
-8
src/main/java/org/wltea/analyzer/dic/Dictionary.java
src/main/java/org/wltea/analyzer/dic/Dictionary.java
+5
-3
src/main/java/org/wltea/analyzer/dic/Monitor.java
src/main/java/org/wltea/analyzer/dic/Monitor.java
+6
-6
src/main/java/org/wltea/analyzer/help/Sleep.java
src/main/java/org/wltea/analyzer/help/Sleep.java
+4
-4
未找到文件。
README.md
浏览文件 @
e81fcaf7
...
...
@@ -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
...
...
pom.xml
浏览文件 @
e81fcaf7
...
...
@@ -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>
...
...
src/main/java/org/wltea/analyzer/cfg/Configuration.java
浏览文件 @
e81fcaf7
...
...
@@ -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
{
...
...
src/main/java/org/wltea/analyzer/dic/Dictionary.java
浏览文件 @
e81fcaf7
...
...
@@ -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
);
...
...
src/main/java/org/wltea/analyzer/dic/Monitor.java
浏览文件 @
e81fcaf7
...
...
@@ -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.ES
Logger
;
import
org.elasticsearch.common.logging.
Loggers
;
import
org.
apache.logging.log4j.
Logger
;
import
org.elasticsearch.common.logging.
ESLoggerFactory
;
public
class
Monitor
implements
Runnable
{
p
ublic
static
ESLogger
logger
=
Loggers
.
getLogger
(
"ik-analyzer"
);
p
rivate
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 {
}
}
}
\ No newline at end of file
}
src/main/java/org/wltea/analyzer/help/Sleep.java
浏览文件 @
e81fcaf7
package
org.wltea.analyzer.help
;
import
org.
elasticsearch.common.logging.ES
Logger
;
import
org.elasticsearch.common.logging.
Loggers
;
import
org.
apache.logging.log4j.
Logger
;
import
org.elasticsearch.common.logging.
ESLoggerFactory
;
public
class
Sleep
{
p
ublic
static
ESLogger
logger
=
Loggers
.
getLogger
(
"ik-analyzer"
);
p
rivate
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 {
}
}
\ No newline at end of file
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录