我用的7+版本,使用插件postman的時(shí)候,PUT提交報(bào)錯(cuò)
代碼:
{
"setting":{
"number_of_shards":3,
"number_of_replicas":1
},
"mapping":{
"man":{
"properties":{
"name":{
"type":"text"
},
"country":{
"type":"keyword"
},
"age":{
"type":"integer"
},
"data":{
"type":"data",
"format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
}
}
},
"woman":{
}
}
}
報(bào)錯(cuò)信息如下:
{
? ? "error": {
? ? ? ? "root_cause": [
? ? ? ? ? ? {
? ? ? ? ? ? ? ? "type": "parse_exception",
? ? ? ? ? ? ? ? "reason": "unknown key [mapping] for create index"
? ? ? ? ? ? }
? ? ? ? ],
? ? ? ? "type": "parse_exception",
? ? ? ? "reason": "unknown key [mapping] for create index"
? ? },
? ? "status": 400
}
大神們?nèi)绾谓鉀Q?
2022-03-29
Incorrect HTTP method for uri [/_mapping?pretty] and method [DELETE], allowed: [GET]
錯(cuò)誤的http請(qǐng)求方法 通過(guò)uri的delete方法,允許get
7.1不支持其他方法請(qǐng)求,http只能用get方法,可以通過(guò)kibana進(jìn)行其他的操作
2021-04-22
http://127.0.0.1:9200/people?include_type_name=true

2021-03-16
7.x 寫法
2020-08-01
es7.x已經(jīng)沒(méi)有類型選擇,統(tǒng)一為_doc,所以要把man,woman刪除,直接設(shè)置屬性參數(shù)即可
{
? ?"settings":{
? ? "number_of_shards":3,
? ? "number_of_replicas":1
? ?},
? ?"mappings":{
? ? "properties":{
? ? "name":{
? ? "type":"text"
? ? },
? ? "age":{
? ? "type":"integer"
? ? },
? ? "country":{
? ? "type":"keyword"
? ? },
? ? "birthday":{
? ? "type":"date",
? ? "format":"yyyy-MM-dd HHmmss||yyyyMMdd||epoch_millis"
? ? }
? ?
? ? }
? ?}
}
2020-06-28
PUT http://bigdata111:9200/store1
{
"mappings": {
"properties": {
"name": {
"type": "text"
},
"age": {
"type": "long"
},
"birthday": {
"type": "date"
}
}
}
}
2019-12-12
在 PUT請(qǐng)求中的鏈接中添加?include_type_name=true即可,如:
2019-11-27
put提交指定id了嗎?
2019-10-24
你的這個(gè)問(wèn)題解決了嗎?急?。?!
2019-07-28
es 7+版本 取消了type 所以圖上的“man” type要?jiǎng)h除
2019-07-09
mapping? 寫錯(cuò)了 ! 是?mappings