#添加索引
PUT /test
{
"settings": {
"index": {
"number_of_shards": 3,
"number_of_replicas": 0
}
}
}
#添加数据指定id
PUT /test/_doc/1
{
"title": "tttttttt",
"content": "hahahhahahahh"
}
#添加数据不指定id
POST /test/_doc
{
"title": "tttttttt",
"content": "ccccccccc"
}
#查询所有类型数据
GET /test/_search
#查询指定类型数据
GET /test/_doc/_search
#查询指定ID数据
GET /test/_doc/1
#查询指定内容数据
GET /test/_doc/_search?q=content:aaaaaaaaaaa
GET /test/_doc/_search
{
"query": {
"match": {
"title": "tttttttt"
}
}
}
#删除索引
DELETE /test
#删除指定ID数据
DELETE /test/_doc/1
#删除索引下所有数据
POST /test/_delete_by_query
{
"query": {
"match_all": {}
}
}
#修改数据
POST /test/_doc/1/_update
{
"doc": {
"content": "aaaaaaaaaaa"
}
}