I want to delete all the documents indexed within a type in Elasticsearch, using the HTTP/REST api, but I don't want to delete the mapping for this type
How can I build the query in the URL to do this?
Before executing command, index/mapping state; (screenshots taken from elasticsearch head plugin web interface)
Command;
curl -XDELETE 'http://localhost:9200/publishercategoryeu/autocomplete/_query' -d '
{
"query": {
"bool": {
"must": [
{
"match_all": {}
}
]
}
}
}
'
Result;
After executing command, index/mapping state;
As we can see we deleted all the documents indexed within a type(mapping) without delete index or type(mapping).