I like to refresh my index daily with a cron job using the following to delete documents in a given index:
curl -XDELETE 'http://localhost:9200/'$1'/?pretty=true'
Where $1 is the index name passed in.
Problem is I seem to lose my mappings on the index.
For example, I have a field I want as
'NOT_ANALYZED'. This works on the initial load when I create the index and the mapping at once. But once I run the above delete command, my mappings are not there.
Is this the proper way to delete documents from my index? If not , how do I do so using curl command?