Я изучаю Elasticsearch 5, и я не нашел способа удалить данные, которые были вставлены в него.
Когда я запрашиваю список записей ,asticsearch возвращает это:
curl -X POST \
http://localhost:9201/usersystem/_search \
-d '{
"query": {
"terms": { "_id": [951] }
}
}'
Return:
{
"took":1,
"timed_out":false,
"_shards":{
"total":5,
"successful":5,
"skipped":0,
"failed":0
},
"hits":{
"total":1,
"max_score":1.0,
"hits":[
{
"_index":"usersystem",
"_type":"usersystem",
"_id":"951",
"_score":1.0,
"_source":{
"id":951,
"name":"User Name",
"email":"user.name@host.com",
"phone":"47-1234-9876",
"documentCode":"9876543-8",
"documentType":"RR",
"gender":"MALE",
"createdOn":"2019-07-04T20:11:47.314Z",
"updateOn":null,
"active":false,
"userId":952
}
}
]
}
}
Читая некоторые примеры, я сделал следующий запрос DELETE, который возвращает ошибку:
Запрос:
curl -X DELETE \
http://localhost:9201/usersystem/_query \
-d '{
"query": {
"terms": { "_id": [951] }
}
}'
Ошибка: No handler found for uri [/usersystem/_query] and method [DELETE]
Как мне сделать запрос на удаление, чтобы удалить запись по _id или id?