Back to Redis

FT.SYNUPDATE

content/commands/ft.synupdate.md

latest2.1 KB
Original Source

Update a synonym group

Examples

Required arguments

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

is index name.

</details> <details open> <summary><code>synonym_group_id</code></summary>

is synonym group to return.

</details>

Use FT.SYNUPDATE to create or update a synonym group with additional terms. The command triggers a scan of all documents.

Optional parameters

<details open> <summary><code>SKIPINITIALSCAN</code></summary>

does not scan and index, and only documents that are indexed after the update are affected.

</details>

Examples

<details open> <summary><b>Update a synonym group</b></summary>

{{< highlight bash >}} 127.0.0.1:6379> FT.SYNUPDATE idx synonym hello hi shalom OK {{< / highlight >}}

{{< highlight bash >}} 127.0.0.1:6379> FT.SYNUPDATE idx synonym SKIPINITIALSCAN hello hi shalom 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-synupdate-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.SYNDUMP]({{< relref "commands/ft.syndump/" >}})

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