The Ansj Analysis plugin(https://github.com/ansjsun/ansj_seg) integrates Lucene Ansj analyzer into elasticsearch, support customized dictionary.
master | 0.90.0 -> master 1.2.0 | 0.90.0 1.0.0 | 0.19.4
In order to install the plugin, simply run:
cd bin plugin -install laigood/elasticsearch-analysis-ansj/1.0.0
also download the dict files,unzip these dict file to your elasticsearch's config folder,such as: your-es-root/config/ansj
cd config wget http://github.com/downloads/laigood/elasticsearch-analysis-ansj/ansj.zip --no-check-certificate unzip ansj.zip rm ansj.zip
you need a service restart after that!
Dict Configuration (es-root/config/ansj/userLibrary.dic)
index: analysis: analyzer: ansj: alias: [ansj_analyzer] type: org.elasticsearch.index.analysis.AnsjAnalyzerProvider
Or
index.analysis.analyzer.ik.type : "ansj"