常用操作
# 创建索引
PUT /users
{
"mappings": {
"properties": {
"id": {
"type": "long"
},
"name": {
"type": "keyword"
},
"age": {
"type": "integer"
}
}
}
}
# 查询
GET /users/_search
{
"query": {
"match": {
"age": 17
}
}
}
# 查询id
GET /users/_doc/NYtsnYoBajWSlaMO9fUO
# 添加doc
POST /users/_doc
{
"name": "qq",
"age":17
}
# 修改、添加doc
PUT /users/_doc/1
{
"id": 1,
"name": "lsy",
"age":17
}
标签:users,doc,age,Elasticsearch,type,id,name
From: https://www.cnblogs.com/new-bee-2023/p/17707178.html