说明
确保将 192.168.1.67
替换为你的 Elasticsearch 主机地址,
9200
替换为 Elasticsearch 的端口号,
relay_protection_data
替换为你的索引名称
API
- 查看分析器和过滤器
GET http://192.168.1.67:9200/relay_protection_data/_settings
- 删除多余分析器
删除前
{
"analyzer": {
"text_anlyze": {
"filter": "py",
"tokenizer": "ik_max_word"
},
"completion_analyzer": {
"filter": "py",
"tokenizer": "ik_max_word"
},
"synonyms_anlyzer": {
"filter": [
"my_synonyms"
],
"tokenizer": "ik_max_word"
},
"text_anlyzer": {
"filter": [
"py"
],
"tokenizer": "ik_max_word"
}
}
}
删除后
{
"analyzer": {
"completion_analyzer": {
"filter": "py",
"tokenizer": "ik_max_word"
},
"synonyms_anlyzer": {
"filter": [
"my_synonyms"
],
"tokenizer": "ik_max_word"
},
"text_anlyzer": {
"filter": [
"py"
],
"tokenizer": "ik_max_word"
}
}
}
PUT http://192.168.1.67:9200/relay_protection_data/_settings
参数
{
"index": {
"analysis": {
"analyzer": {
"text_anlyze": {
"filter": null,
"tokenizer": null
}
}
}
}
}
- 关闭索引
POST http://192.168.1.67:9200/relay_protection_data/_close
- 重新打开索引
POST http://192.168.1.67:9200/relay_protection_data/_open
问题
- 如果PUT _settings遇到”illegal_argument_exception“,可以尝试先_close,再_open;注意_close会造成服务中断