1.下載 根據自己的版本進行下載
https://github.com/medcl/elasticsearch-analysis-ik/releases
2.安裝 解壓到 當前elasticsearch的插件目錄
unzip elasticsearch-analysis-ik-6.2.2.zip -d ik
3.自定義分詞 IK分詞器的詞庫
vim /usr/local/elasticsearch/plugins/ik/config/IKAnalyzer.cfg.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>IK Analyzer 擴展配置</comment>
<!--用戶可以在這里配置自己的擴展字典 -->
<entry key="ext_dict">/asdf/asdf/asdf/asdf.dtd</entry>
<!--用戶可以在這里配置自己的擴展停止詞字典-->
<entry key="ext_stopwords"></entry>
<!--用戶可以在這里配置遠程擴展字典 -->
<entry key="remote_ext_dict">http://192.168.65.131/remote.php</entry>
<!--用戶可以在這里配置遠程擴展停止詞字典-->
<!-- <entry key="remote_ext_stopwords">words_location</entry> -->
</properties>
4.創建遠程文件庫:[檢測時間的變動]
<?php
$dict=<<<DICT
逼格
DICT;
header('Last-Modified: Sun, 30 Apr 2017 14:19:15 GMT', true, 200);
//header('Last-Modified: '.gmdate('D, d M Y H:i:s', time()).' GMT', true, 200);
echo $dict;