{
  "schema_version": 2,
  "id": "commands/ft.explaincli",
  "title": "FT.EXPLAINCLI",
  "url": "https://redis.io/docs/latest/commands/ft.explaincli/",
  "summary": "Returns the execution plan for a complex query",
  "since": "1.0.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": "8a7bb669888dc9436c2788280ae2ce44d8f228fd43c9fb020e04a5d7d9c3ccdc",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Return the execution plan for a complex query but formatted for easier reading without using `redis-cli --raw`\n\n[Examples](#examples)"
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open>\n<summary><code>index</code></summary>\n\nis index name. You must first create the index using [`FT.CREATE`](https://redis.io/docs/latest/commands/ft.create).\n</details>\n\n<details open>\n<summary><code>query</code></summary>\n\nis query string, as if sent to FT.SEARCH`.\n</details>"
    },
    {
      "id": "optional-arguments",
      "title": "Optional arguments",
      "role": "parameters",
      "text": "<details open>\n<summary><code>DIALECT {dialect_version}</code></summary>\n\nis dialect version under which to execute the query. If not specified, the query executes 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\n> [!NOTE]\n>  \n> In the returned response, a `+` on a term is an indication of stemming.\n\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "<details open>\n<summary><b>Return the execution plan for a complex query</b></summary>\n\n\n$ redis-cli\n\n127.0.0.1:6379> FT.EXPLAINCLI rd \"(foo bar)|(hello world) @date:[100 200]|@date:[500 +inf]\"\n 1) INTERSECT {\n 2)   UNION {\n 3)     INTERSECT {\n 4)       UNION {\n 5)         foo\n 6)         +foo(expanded)\n 7)       }\n 8)       UNION {\n 9)         bar\n10)         +bar(expanded)\n11)       }\n12)     }\n13)     INTERSECT {\n14)       UNION {\n15)         hello\n16)         +hello(expanded)\n17)       }\n18)       UNION {\n19)         world\n20)         +world(expanded)\n21)       }\n22)     }\n23)   }\n24)   UNION {\n25)     NUMERIC {100.000000 <= @date <= 200.000000}\n26)     NUMERIC {500.000000 <= @date <= inf}\n27)   }\n28) }\n29)\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 [bulk string replies](https://redis.io/docs/latest/develop/reference/protocol-spec#bulk-strings) containing the query execution plan in CLI format.\n* [Simple error reply](https://redis.io/docs/latest/develop/reference/protocol-spec#simple-errors) in these cases: no such index, syntax error in query.\n\n**RESP3:**\n\nOne of the following:\n* [Array](https://redis.io/docs/latest/develop/reference/protocol-spec#arrays) of [bulk string replies](https://redis.io/docs/latest/develop/reference/protocol-spec#bulk-strings) containing the query execution plan in CLI format.\n* [Simple error reply](https://redis.io/docs/latest/develop/reference/protocol-spec#simple-errors) in these cases: no such index, syntax error in query."
    },
    {
      "id": "see-also",
      "title": "See also",
      "role": "related",
      "text": "[`FT.CREATE`](https://redis.io/docs/latest/commands/ft.create) | [`FT.SEARCH`](https://redis.io/docs/latest/commands/ft.search) | [`FT.CONFIG SET`](https://redis.io/docs/latest/commands/ft.config-set)"
    },
    {
      "id": "related-topics",
      "title": "Related topics",
      "role": "related",
      "text": "[RediSearch](https://redis.io/docs/latest/develop/ai/search-and-query)"
    }
  ],
  "examples": []
}
