You should remove the โqueryโ from your data. You only need this for _search, and you must use the _query entry point for deletion. In this case, it is obvious that the message is just a request, which makes its redesign (and actually irrelevant) to explicitly indicate the request to it.
I.e:
curl -XPOST 'localhost:9200/myindex/mydoc/_search' -d '{"query":{"term":{"supplier":"ABC"}}}'
will work just fine for the search. But for uninstall by request, if you try:
curl -XDELETE 'localhost:9200/myindex/mydoc/_query' -d '{"query":{"term":{"supplier":"ABC"}}}'
it will not work (note the change of the entry point to _query, as well as the CURL parameter to delete). You need to call:
curl -XDELETE 'localhost:9200/myindex/mydoc/_query' -d '{"term":{"supplier":"ABC"}}'
Let me know if this helps.
If you want to do this in HEAD:
put /stock/one/_query in the text box of any query next to the drop-down field "GET / PUT / POST / DELETE"
select DELETE from the drop-down menu
request body should be {"term":{"vendor":"Socks"}}
Your problem was that you used the request body: {"query":{"term":{"vendor":"Socks"}}} This is fine for searching, but not for deleting.
source share