{
  "schema_version": 2,
  "id": "commands/ft.tagvals",
  "title": "FT.TAGVALS",
  "url": "https://redis.io/docs/latest/commands/ft.tagvals/",
  "summary": "Returns the distinct tags indexed in a Tag field",
  "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": "1c5f1f49f043b211c56ea2c889a4dee51b1edcf359ce111e0673a543d8349d27",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Return a distinct set of values indexed in a Tag field\n\n[Examples](#examples)"
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open>\n<summary><code>index</code></summary>\n\nis full-text 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>field_name</code></summary>\n\nis name of a Tag file defined in the schema.\n</details>\n\nUse FT.TAGVALS if your tag indexes things like cities, categories, and so on."
    },
    {
      "id": "limitations",
      "title": "Limitations",
      "role": "limits",
      "text": "FT.TAGVALS provides no paging or sorting, and the tags are not alphabetically sorted. FT.TAGVALS only operates on [tag fields](https://redis.io/docs/latest/develop/ai/search-and-query/advanced-concepts/tags).\nThe returned strings are lowercase with whitespaces removed, but otherwise unchanged."
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "<details open>\n<summary><b>Return a set of values indexed in a Tag field</b></summary>\n\n\n127.0.0.1:6379> FT.TAGVALS idx myTag\n1) \"Hello\"\n2) \"World\"\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 distinct tag values as [bulk strings](https://redis.io/docs/latest/develop/reference/protocol-spec#bulk-strings).\n* [Simple error reply](https://redis.io/docs/latest/develop/reference/protocol-spec#simple-errors) in these cases: no such index, not a tag field.\n\n**RESP3:**\n\nOne of the following:\n* [Set](https://redis.io/docs/latest/develop/reference/protocol-spec#sets) of distinct tag values as [bulk strings](https://redis.io/docs/latest/develop/reference/protocol-spec#bulk-strings).\n* [Simple error reply](https://redis.io/docs/latest/develop/reference/protocol-spec#simple-errors) in these cases: no such index, not a tag field."
    },
    {
      "id": "see-also",
      "title": "See also",
      "role": "related",
      "text": "[`FT.CREATE`](https://redis.io/docs/latest/commands/ft.create)"
    },
    {
      "id": "related-topics",
      "title": "Related topics",
      "role": "related",
      "text": "- [Tag fields](https://redis.io/docs/latest/develop/ai/search-and-query/advanced-concepts/tags)\n- [RediSearch](https://redis.io/docs/latest/develop/ai/search-and-query)"
    }
  ],
  "examples": []
}
