更新商品索引,捕获 ‘非法参数’ 异常?
由于之前创建商品索引是‘type’类型写错了,写成了:
curl -H 'Content-type:application/json' -XPOST http://localhost:9200/products/_mapping/_doc?pretty -d '{
"properties": {
"type": {"type": "text", "analyzer": "ik_smart"},
导致现在更新索引是抛出异常:
{
"error" : {
"root_cause" : [
{
"type" : "illegal_argument_exception",
"reason" : "mapper [type] of different type, current_type [text], merged_type [keyword]"
}
],
"type" : "illegal_argument_exception",
"reason" : "mapper [type] of different type, current_type [text], merged_type [keyword]"
},
"status" : 400
}
这个要怎么解决啊?
行吧,把之前的索引删了重来一遍
推荐文章: