我正在尝试在elasticsearch中的现有索引中添加分析器。
以下是代码:-
curl -X POST "localhost:9200/existing_index_name/_mapping/_doc?pretty" -H 'Content-Type: application/json' -d'
{
"settings":{
"analysis":{
"analyzer":{
"analyzer_startswith":{
"tokenizer":"keyword",
"filter":["lowercase"]
}
}
}
}
}
'
下面是我得到的错误:-
["type" : "mapper_parsing_exception",
"reason" : "Root mapping definition has unsupported parameters: [settings : {analysis={analyzer={analyzer_startswith={tokenizer=keyword, filter=[lowercase]}}}}]"
2条答案
按热度按时间inkz8wg91#
您需要调用
_settings
端点,而不是_mapping
端点:不过,请注意,您需要首先关闭索引:
然后在更新设置后,您需要再次打开它
vs91vp4v2#
必须先关闭索引 curl -XPOST“http://localhost:9200/indexname/_close”
然后在curl中将Map更改为设置
要打开索引 curl -XPOST“http://localhost:9200/indexname/_open”