hanlp好处的,就是它的data字典比较齐全.
github上有国人写hanlp支持es的插件
https://github.com/pengcong90/elasticsearch-analysis-hanlp
下载它的安装release包
下载发现解压按它的安装要求总找不到hanlp.properties文件
将源码git下来,发现路径有问题.
package org.elasticsearch.index.analysis;
import com.hankcs.hanlp.HanLP;
import com.hankcs.hanlp.utility.Predefine;
import com.hankcs.lucene4.HanLPIndexAnalyzer;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.inject.assistedinject.Assisted;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.env.Environment;
import org.elasticsearch.index.IndexSettings;
/**
*/
public class HanLPAnalyzerProvider extends AbstractIndexAnalyzerProvider<HanLPIndexAnalyzer> {
private final HanLPIndexAnalyzer analyzer;
private static String sysPath = String.valueOf(System.getProperties().get("user.dir"));
@Inject
public HanLPAnalyzerProvider(IndexSettings ind