curl -H Content-Type applicationjson -XPUT 100718949200_templatesecure -d template secure settings indexnumber_of_shards 1number_of_replicas 0 mappings docproperties tags type textfields
这个报错是因为mapping定义中有不支持的参数。可以尝试使用以下mapping定义来解决这个问题:
{
"template": "secure*",
"settings": {
"index.number_of_shards": 1,
"number_of_replicas": 0
},
"mappings": {
"_doc": {
"properties": {
"tags": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
}
}
注意,这里是使用_doc作为mapping的type,而不是doc。同时,也可以将_doc换成其他名字,只要保证和实际使用的type一致即可
原文地址: https://www.cveoy.top/t/topic/hbFc 著作权归作者所有。请勿转载和采集!