提问要多花一点心思哦

es 5.4.2 在已有索引上自定义词性分析器,必须要先关掉索引吗,能不关掉索引的情况下,新增自定义分析器吗

Elasticsearch | 作者 fengxue | 发布于2018年09月25日 | 阅读数:3452

PUT doctest/_settings
{
"index": {
"analysis": {
"analyzer": {
"comma": {
"type": "pattern",
"pattern": ","
}
}
}
}
}

提示{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "Can't update non dynamic settings [[index.analysis.analyzer.comma.pattern, index.analysis.analyzer.comma.type]] for open indices [[doctest/k1ydiwt1QbiPpZ-d-1pZmw]]"
}
],
"type": "illegal_argument_exception",
"reason": "Can't update non dynamic settings [[index.analysis.analyzer.comma.pattern, index.analysis.analyzer.comma.type]] for open indices [[doctest/k1ydiwt1QbiPpZ-d-1pZmw]]"
},
"status": 400
}
已邀请:

rochy - rochy_he

赞同来自:

修改完全没什么意义(即便修改成功,你意见添加的内容也不会因为新的分词器而生效,依旧需要你重新索引)
推荐你按照新的配置新建一个索引,然后借助 reindex 同步数据

zyb1994111

赞同来自:

新增分词器,必须要先关闭索引,添加自定义的,然后开启。但是添加完成之后analyzer不能修改,只能修改search_analyzer

aa1356889

赞同来自:

撸主解决了吗。。

要回复问题请先登录注册