Back to Redis

FT.DROPINDEX

content/commands/ft.dropindex.md

latest2.4 KB
Original Source

Delete an index

Examples

Required arguments

<details open> <summary><code>index</code></summary>

is full-text index name. You must first create the index using [FT.CREATE]({{< relref "commands/ft.create/" >}}).

</details>

Optional arguments

<details open> <summary><code>DD</code></summary>

drop index operation that, if set, deletes the actual document keys. FT.DROPINDEX index DD is an asynchronous operation.

By default, FT.DROPINDEX does not delete the documents associated with the index. Adding the DD option deletes the documents as well. If an index creation is still running ([FT.CREATE]({{< relref "commands/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. To check the completion of the indexing, use [FT.INFO]({{< relref "commands/ft.info/" >}}).

</details>

Examples

<details open> <summary><b>Delete an index</b></summary>

{{< highlight bash >}} 127.0.0.1:6379> FT.DROPINDEX idx DD OK {{< / highlight >}}

</details>

Redis Software and Redis Cloud compatibility

| Redis Software | Redis Cloud Flexible & Annual | Redis Cloud Free & Fixed | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:-----------------|:------| | <span title="Supported">✅ Supported</span> | <span title="Supported">✅ Supported</span> | <span title="Supported">✅ Supported</nobr></span> | |

Return information

{{< multitabs id="ft-dropindex-return-info" tab1="RESP2" tab2="RESP3" >}}

One of the following:

  • [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): OK if executed correctly.
  • [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: no such index.

-tab-sep-

One of the following:

  • [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): OK if executed correctly.
  • [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: no such index.

{{< /multitabs >}}

See also

[FT.CREATE]({{< relref "commands/ft.create/" >}}) | [FT.INFO]({{< relref "commands/ft.info/" >}})

[RediSearch]({{< relref "/develop/ai/search-and-query/" >}})