慕用8226845
2018-11-14 18:42
{
"settings":{
"number_of_shards":3,
"number_of_replicas":1
},
"mappings":{
"man":{
"properties":{
"name":{
"type":"text"
},
"country":{
"type":"keyword"
},
"age":{
"type":"integer"
},
"date":{
"type":"date",
"format":"yyyy-MM-dd HH-mm-ss||yyyy-MM-dd"
}
}
},
"woman":{
}
}
}
返回结果
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "Rejecting mapping update to [people] as the final mapping would have more than 1 type: [woman, man]"
}
],
"type": "illegal_argument_exception",
"reason": "Rejecting mapping update to [people] as the final mapping would have more than 1 type: [woman, man]"
},
"status": 400
}
Indices created in 6.x only allow a single-type per index. Any name can be used for the type, but there can be only one.
错误翻译拒绝将映射更新发送给[people],因为最终映射将不止一种类型:[女性,男性]
去掉woman 这个类型
{
"acknowledged": true,
"shards_acknowledged": true,
"index": "people"
}
ElasticSearch入门
67752 学习 · 308 问题