How to remove all the documents from an index in Redisearch?

2.9k Views Asked by At

I want all the documents to be removed from a particular index in Redisearch. I have come across commands for deleting records with the documentid known. Can we delete all the records without using documentids?

Please suggest something. Thank you.

3

There are 3 best solutions below

0
On

You can do this in both ways like:

  1. DropIndex with all documents by running this command - -- FT.DROPINDEX yourindex DD
  2. OR if you need to fetch all documents and delete by id you can do it through a loop or pipeline
2
On

Could you just drop the index FT.DROPINDEX and recreate it?

0
On

Probably already solved in your case, but since the google sends here as one of the first result and it's still not resolved: Use FT.DROP "indexName". It's not to be found in the official documentation list but for me it worked.