GET _search
{
"query": {
"match_all": {}
}
}
创建索引
PUT person
PUT person2
删除索引
DELETE person2
查询索引
GET person2
GET person
添加映射
PUT /person/_mapping
{
"properties":{
"name":{
"type": "text"
},
"age":{
"type": "integer"
}
}
}
GET person/_mapping
添加字段
PUT /person/_mapping
{
"properties":{
"address":{
"type": "text"
}
}
}
添加文档
POST /person/_doc/1
{
"name":"zhangsan",
"age":18,
"addres":"北京"
}
查询文档
GET /person/_doc/1
添加文档不指定id
POST /person/_doc
{
"name":"李四",
"age":"83",
"address":"北京天安门"
}
查询所有文档
GET /person/_search
删除指定id 的文档
DELETE /person/_doc/1
标签:GET,doc,person2,person,初学,文档,PUT,ES From: https://www.cnblogs.com/wscp/p/17575978.html