集成

  1. 下载安装插件https://github.com/medcl/elasticsearch-analysis-ik/tree/6.x
  2. 下载后mvn打包,结果再realease中
  3. 将包放入elasticsearch的plungin中,并且解压
  4. 指定分词器
    1. ik_max_word
    2. ik_smart

同义词

  1. 更改配置文件

    { 
    	"max_result_window" : 100000000,
    	"number_of_shards":10,
    	"analysis": {
    		"filter": {
    			"my_synonym_filter": {
    				"type": "synonym",
    				"synonyms_path": "analysis/synonyms.txt"
    			}
    		},
    	"analyzer": {
    		"ik_syno": {
    			"type": "custom",
    			"tokenizer": "ik_smart",
    			"filter": [
    				"my_synonym_filter"
    			]
    		},
    		"ik_syno_max": {
    			"type": "custom",
    			"tokenizer": "ik_max_word",
    			"filter": [
    				"my_synonym_filter"
    			]
    		}
    	}
    }
    }