fix logging
This commit is contained in:
parent
7d91be5009
commit
29b6454817
@ -66,6 +66,9 @@ index:
|
|||||||
ik:
|
ik:
|
||||||
alias: [ik_analyzer]
|
alias: [ik_analyzer]
|
||||||
type: org.elasticsearch.index.analysis.IkAnalyzerProvider
|
type: org.elasticsearch.index.analysis.IkAnalyzerProvider
|
||||||
|
ik_max_word:
|
||||||
|
type: ik
|
||||||
|
use_smart: false
|
||||||
ik_smart:
|
ik_smart:
|
||||||
type: ik
|
type: ik
|
||||||
use_smart: true
|
use_smart: true
|
||||||
|
@ -2,7 +2,6 @@ package org.elasticsearch.index.analysis;
|
|||||||
|
|
||||||
import org.elasticsearch.common.inject.Inject;
|
import org.elasticsearch.common.inject.Inject;
|
||||||
import org.elasticsearch.common.inject.assistedinject.Assisted;
|
import org.elasticsearch.common.inject.assistedinject.Assisted;
|
||||||
import org.elasticsearch.common.logging.ESLogger;
|
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.env.Environment;
|
import org.elasticsearch.env.Environment;
|
||||||
import org.elasticsearch.index.Index;
|
import org.elasticsearch.index.Index;
|
||||||
@ -11,7 +10,6 @@ import org.wltea.analyzer.lucene.IKAnalyzer;
|
|||||||
|
|
||||||
public class IkAnalyzerProvider extends AbstractIndexAnalyzerProvider<IKAnalyzer> {
|
public class IkAnalyzerProvider extends AbstractIndexAnalyzerProvider<IKAnalyzer> {
|
||||||
private final IKAnalyzer analyzer;
|
private final IKAnalyzer analyzer;
|
||||||
private ESLogger logger=null;
|
|
||||||
@Inject
|
@Inject
|
||||||
public IkAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, Environment env, @Assisted String name, @Assisted Settings settings) {
|
public IkAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, Environment env, @Assisted String name, @Assisted Settings settings) {
|
||||||
super(index, indexSettings, name, settings);
|
super(index, indexSettings, name, settings);
|
||||||
|
@ -51,25 +51,6 @@ public class Configuration {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 返回useSmart标志位
|
|
||||||
* useSmart =true ,分词器使用智能切分策略, =false则使用细粒度切分
|
|
||||||
* @return useSmart
|
|
||||||
*/
|
|
||||||
public boolean useSmart() {
|
|
||||||
return useSmart;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置useSmart标志位
|
|
||||||
* useSmart =true ,分词器使用智能切分策略, =false则使用细粒度切分
|
|
||||||
* @param useSmart
|
|
||||||
*/
|
|
||||||
public void setUseSmart(boolean useSmart) {
|
|
||||||
this.useSmart = useSmart;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public List<String> getExtDictionarys(){
|
public List<String> getExtDictionarys(){
|
||||||
List<String> extDictFiles = new ArrayList<String>(2);
|
List<String> extDictFiles = new ArrayList<String>(2);
|
||||||
|
@ -129,8 +129,6 @@ public final class IKSegmenter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//对分词进行歧义处理
|
//对分词进行歧义处理
|
||||||
logger.error("useSmart:"+String.valueOf(useSmart));
|
|
||||||
|
|
||||||
this.arbitrator.process(context, useSmart);
|
this.arbitrator.process(context, useSmart);
|
||||||
//将分词结果输出到结果集,并处理未切分的单个CJK字符
|
//将分词结果输出到结果集,并处理未切分的单个CJK字符
|
||||||
context.outputToResult();
|
context.outputToResult();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user