I want to delete all the documents in the index without deleting the index . How to achieve this ?
I want to delete all the documents in the index without deleting the index . How to achieve this ?
You could use
POST /index-name-000001/_delete_by_query
{
"query": {
"match_all": {}
}
}
Further information is provided in https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html
If it's a very large index add,?conflicts=proceed, so it's run on the background.
POST my-index-000001/_delete_by_query?conflicts=proceed
{
"query": {
"match_all": {}
}
}