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
A simple delete by query with a match_all query should do the trick. You can grab more info here :
delete by query api
Alternatively, you can delete the whole type and make use of the template api. Just drop a file in your config/templates/ folder containing your template, and you'll never loose it. The mapping will indeed be lost when you'll delete the mapping, but the template will be reused as soon as you index something again. Here's some more info :
template api
EDIT: new delete api: https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete.html