FT.DROPINDEX

Available in:
Redis Stack / Search 2.0.0
Time complexity:
O(1) or O(N) if documents are deleted, where N is the number of keys in the keyspace

Delete an index

Syntax

FT.DROPINDEX index 
          [ DD]

Examples

Required parameters

index

is full-text index name. You must first create the index using FT.CREATE.

Optional parameters

DD

drop operation that, if set, deletes the actual document hashes.

Notes:

  • By default, FT.DROPINDEX does not delete the document hashes associated with the index. Adding the DD option deletes the hashes as well.
  • When using FT.DROPINDEX with the parameter DD, if an index creation is still running (FT.CREATE is running asynchronously), only the document hashes that have already been indexed are deleted. The document hashes left to be indexed remain in the database. You can use FT.INFO to check the completion of the indexing.

Return

FT.DROPINDEX returns a simple string reply OK if executed correctly, or an error reply otherwise.

Examples

Delete an index
127.0.0.1:6379> FT.DROPINDEX idx DD
OK

See also

FT.CREATE | FT.INFO

RediSearch