content/commands/ft.sugadd.md
Add a suggestion string to an auto-complete suggestion dictionary
is suggestion dictionary key.
</details> <details open> <summary><code>string</code></summary>is suggestion string to index.
</details> <details open> <summary><code>score</code></summary>is floating point number of the suggestion string's weight.
</details>The auto-complete suggestion dictionary is disconnected from the index definitions and leaves creating and updating suggestions dictionaries to the user.
increments the existing entry of the suggestion by the given score, instead of replacing the score. This is useful for updating the dictionary based on user queries in real time.
</details> <details open> <summary><code>PAYLOAD {payload}</code></summary>saves an extra payload with the suggestion, that can be fetched by adding the WITHPAYLOADS argument to [FT.SUGGET]({{< relref "commands/ft.sugget/" >}}).
{{< highlight bash >}} 127.0.0.1:6379> FT.SUGADD sug "hello world" 1 (integer) 3 {{< / highlight >}}
</details>| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Standard</span> <span title="Not supported"><nobr>❌ Active-Active</nobr></span> | <span title="Not supported">❌ Standard</span> <span title="Not supported"><nobr>❌ Active-Active</nobr></span> | Not supported on clustered databases. |
{{< multitabs id="ft-sugadd-return-info" tab1="RESP2" tab2="RESP3" >}}
[Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): number of elements added to the suggestion dictionary.
-tab-sep-
[Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): number of elements added to the suggestion dictionary.
{{< /multitabs >}}
[FT.SUGGET]({{< relref "commands/ft.sugget/" >}}) | [FT.SUGDEL]({{< relref "commands/ft.sugdel/" >}}) | [FT.SUGLEN]({{< relref "commands/ft.suglen/" >}})
[RediSearch]({{< relref "/develop/ai/search-and-query/" >}})