Java to delete all the documents in the Elastic search using json queries

Give me the code snippet for elastic search 7.3.0 to delete all the records in the index using match all json query in a java code.

Just use the delete index API if you want to remove everything.

1 Like

That should be completely deleting the index.. I need to deleting the full documents inside the index.Help me

Iam not need for deleting the index. Iam only need for delete all the records inside the index .
Please help me

You can do this using delete by query, which results in all documents being deleted individually. This can be quite slow and expensive and simply deleting and recreating the index is much more fast and efficient.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.