【发布时间】:2014-09-21 02:12:49
【问题描述】:
我想更改 elasticsearch 中现有索引的设置和映射。但是,我得到了错误。
curl -XPOST localhost:9200/myindex/_close
{"已确认":true}
curl -XPUT localhost:9200/myindex/_settings -d '{
"index": {
"analysis": {
"analyzer": {
"custom_analyzer": {
"type": "custom",
"tokenizer": "keyword",
"filter": ["lowercase"]
}
}
}
}
}'
{"已确认":true}
curl -XPUT localhost:9200/myindex/mytype/_mapping -d '{
"properties": {
"myfield": {
"type": "string",
"search_analyzer": "custom_analyzer",
"index_analyzer": "custom_analyzer"
}
}
}'
{"error":"MergeMappingException[Merge failed with failures {[mapper [myfield] has different index_analyzer]}]","status":400}
我做错了什么?
【问题讨论】:
-
如果在现有类型中引入了新字段,您始终可以添加映射。要获得更好的方法,您可以通过修改映射将一种索引类型的数据传输到另一种新类型。
-
我明白,必须为我想要的内容重新索引。
标签: elasticsearch