es集群,三台,每台都得安裝ik插件,重啟,先重啟Node節點,最后重啟master節點
ik分詞器的github地址:https://github.com/medcl/elasticsearch-analysis-ik
選擇與es集群版本對應的ik版本,下載zip包
在es的plugins目錄下新建一個ik目錄,將下載好的zip包解壓放入
重啟es服務器,重啟后可以通過bin/elasticsearch-pulgins list查看當前已加載的插件
新建es索引
curl -XPUT http://localhost:9200/index
選擇數據源字段,這里采用從MySQL數據庫同步到es的數據做源數據,如下,content即為源數據可能出現中文字段,
curl -XPOST http://localhost:9200/index/_mapping -H 'Content-Type:application/json' -d' { "properties": { "content": { "type": "text", "analyzer": "ik_max_word", "search_analyzer": "ik_smart" } } }'
