To delete an index, you can use the Elasticsearch's REST API.
First, use the _cat/indices endpoint to list existing indices.
For example, the command curl -H "Accept: application/text" elasticsearch:9200/_cat/indices returns output like the following:
1 2 3 4 5 6 7 | |
Create a list containing all indices used by the DXP, including the custom indices as well.
Then, delete them by using the delete index endpoint
1 2 3 | |
Tip
To quickly delete all existing Elasticsearch indices, you can use the _all keyword as the name of the index, as in the following request: curl --request DELETE https://elasticsearch:9200/_all.
Always review the list of existing indices and confirm they are safe to delete before executing this command, as it permanently removes data.
To update the schema and then reindex the search, use the following commands:
1 2 | |