分析器配置:
{
"settings": {
"number_of_shards": 5,
"number_of_replicas": 1,
"analysis": {
"analyzer": {
"ik_synonym": {
"type": "custom",
"tokenizer": "ik_max_word",
"filter": [
"my_synonym_filter"
]
}
},
"filter": {
"my_synonym_filter": {
"type": "synonym",
"synonyms_path": "analysis/synonym.txt"
}
}
}
}
}
在es的config目录创建 analysis/synonym.txt 文件即可
cd /usr/local/elasticsearch-5.2.2/config
mkdir analysis && touch analysis/synonym.txt