content/commands/ft.sugget.md
Get completion suggestions for a prefix
is suggestion dictionary key.
</details> <details open> <summary><code>prefix</code></summary>is prefix to complete on.
</details>performs a fuzzy prefix search, including prefixes at Levenshtein distance of 1 from the prefix sent.
</details> <details open> <summary><code>MAX num</code></summary>limits the results to a maximum of num (default: 5).
also returns the score of each suggestion. This can be used to merge results from multiple instances.
</details> <details open> <summary><code>WITHPAYLOADS</code></summary>returns optional payloads saved along with the suggestions. If no payload is present for an entry, it returns a null reply.
</details>FT.SUGGET returns an array reply, which is a list of the top suggestions matching the prefix, optionally with score after each entry.
{{< highlight bash >}} 127.0.0.1:6379> FT.SUGGET sug hell FUZZY MAX 3 WITHSCORES
| 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-sugget-return-info" tab1="RESP2" tab2="RESP3" >}}
[Array]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of the top suggestions matching the prefix, optionally with a score after each entry.
-tab-sep-
[Array]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of the top suggestions matching the prefix, optionally with a score after each entry.
{{< /multitabs >}}
[FT.SUGADD]({{< relref "commands/ft.sugadd/" >}}) | [FT.SUGDEL]({{< relref "commands/ft.sugdel/" >}}) | [FT.SUGLEN]({{< relref "commands/ft.suglen/" >}})
[RediSearch]({{< relref "/develop/ai/search-and-query/" >}})