1.创建索引
people/man/_mappings POST
{
"man": {
"properties": {
"name": {
"type": "text"
},
"country": {
"type": "keyword"
},
"age": {
"type": "integer"
},
"date": {
"type": "date",
"format": "yyyy-MM-dd"
}
}
}
}
2.插入数据
people/man/1 PUT
{
"name": "武志祥",
"country": "中国",
"age": 22,
"date": "1997-08-27"
}
自动索引:
people/man POST
{
"name": "马越",
"country": "中国",
"age": 22,
"date": "1997-08-27"
}
3.修改数据
people/man/2/_update
{
"doc": {
"name": "武志祥2",
"country": "中国",
"age": 22,
"date": "1997-08-27"
}
}