{
  "schema_version": 2,
  "id": "commands/ft.spellcheck",
  "title": "FT.SPELLCHECK",
  "url": "https://redis.io/docs/latest/commands/ft.spellcheck/",
  "summary": "Performs spelling correction on a query, returning suggestions for misspelled terms",
  "since": "1.4.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T09:47:58+01:00",
  "page_type": "content",
  "content_hash": "883070121f128e5bdf43b5ce70002059356139d07c88b0b28d9978e4b1d757c4",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Perform spelling correction on a query, returning suggestions for misspelled terms\n\n[Examples](#examples)"
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open>\n<summary><code>index</code></summary>\n\nis index with the indexed terms.\n</details>\n\n<details open>\n<summary><code>query</code></summary> \n\nis search query.\n</details>\n\nSee [Spellchecking](https://redis.io/docs/latest/develop/ai/search-and-query/advanced-concepts/spellcheck) for more details."
    },
    {
      "id": "optional-arguments",
      "title": "Optional arguments",
      "role": "parameters",
      "text": "<details open>\n<summary><code>TERMS</code></summary>\n\nspecifies an inclusion (`INCLUDE`) or exclusion (`EXCLUDE`) of a custom dictionary. To learn more about managing custom dictionaries, see [`FT.DICTADD`](https://redis.io/docs/latest/commands/ft.dictadd), [`FT.DICTDEL`](https://redis.io/docs/latest/commands/ft.dictdel), and [`FT.DICTDUMP`](https://redis.io/docs/latest/commands/ft.dictdump).\n\nYou can specify multiple inclusion and exclusion `TERMS`.\n</details>\n\n<details open>\n<summary><code>DISTANCE</code></summary> \n\nis maximum Levenshtein distance for spelling suggestions (default: 1, max: 4).\n</details>\n\n<details open>\n<summary><code>DIALECT {dialect_version}</code></summary> \n\nselects the dialect version under which to execute the query. If not specified, the query will execute under the default dialect version set during module initial loading or via [`FT.CONFIG SET`](https://redis.io/docs/latest/commands/ft.config-set) command.\n</details>"
    },
    {
      "id": "return",
      "title": "Return",
      "role": "returns",
      "text": "FT.SPELLCHECK returns an array reply, in which each element represents a misspelled term from the query. The misspelled terms are ordered by their order of appearance in the query. \nEach misspelled term, in turn, is a 3-element array consisting of the constant string `TERM`, the term itself and an array of suggestions for spelling corrections.\nEach element in the spelling corrections array consists of the score of the suggestion and the suggestion itself. The suggestions array, per misspelled term, is ordered in descending order by score.\nThe score is calculated by dividing the number of documents in which the suggested term exists by the total number of documents in the index. Results can be normalized by dividing scores by the highest score."
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "<details open>\n<summary><b>Perform spelling correction on a query</b></summary>\n\n\n127.0.0.1:6379> FT.SPELLCHECK idx held DISTANCE 2\n1) 1) \"TERM\"\n   2) \"held\"\n   3) 1) 1) \"0.66666666666666663\"\n         2) \"hello\"\n      2) 1) \"0.33333333333333331\"\n         2) \"help\"\n\n</details>"
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis Cloud<br />Flexible & Annual | Redis Cloud<br />Free & Fixed | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:-----------------|:------|\n| <span title=\"Supported\">&#x2705; Supported</span> | <span title=\"Supported\">&#x2705; Supported</span> | <span title=\"Supported\">&#x2705; Supported</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\nOne of the following:\n* [Array](https://redis.io/docs/latest/develop/reference/protocol-spec#arrays) of spell check results for each term.\n* [Simple error reply](https://redis.io/docs/latest/develop/reference/protocol-spec#simple-errors) in these cases: no such index.\n\n**RESP3:**\n\nOne of the following:\n* [Map](https://redis.io/docs/latest/develop/reference/protocol-spec#maps) with a `results` key containing spell check results for each term.\n* [Simple error reply](https://redis.io/docs/latest/develop/reference/protocol-spec#simple-errors) in these cases: no such index."
    },
    {
      "id": "see-also",
      "title": "See also",
      "role": "related",
      "text": "[`FT.CONFIG SET`](https://redis.io/docs/latest/commands/ft.config-set) | [`FT.DICTADD`](https://redis.io/docs/latest/commands/ft.dictadd) | [`FT.DICTDEL`](https://redis.io/docs/latest/commands/ft.dictdel) | [`FT.DICTDUMP`](https://redis.io/docs/latest/commands/ft.dictdump)"
    },
    {
      "id": "related-topics",
      "title": "Related topics",
      "role": "related",
      "text": "- [Spellchecking](https://redis.io/docs/latest/develop/ai/search-and-query/advanced-concepts/spellcheck)\n- [RediSearch](https://redis.io/docs/latest/develop/ai/search-and-query)"
    }
  ],
  "examples": []
}
