FT.TAGVALS

Available in:
Redis Stack / Search 1.0.0
Time complexity:
O(N)

Return a distinct set of values indexed in a Tag field

Syntax

FT.TAGVALS index field_name

Examples

Required parameters

index

is full-text index name. You must first create the index using FT.CREATE.

field_name

is name of a Tag file defined in the schema.

Use FT.TAGVALS if your tag indexes things like cities, categories, and so on.

Limitations

FT.TAGVALS provides no paging or sorting, and the tags are not alphabetically sorted. FT.TAGVALS only operates on tag fields. The returned strings are lowercase with whitespaces removed, but otherwise unchanged.

Return

FT.TAGVALS returns an array reply of all distinct tags in the tag index.

Examples

Return a set of values indexed in a Tag field
127.0.0.1:6379> FT.TAGVALS idx myTag
1) "Hello"
2) "World"
</details>

## See also

[`FT.CREATE`](/commands/ft.create) 

## Related topics

- [Tag fields](/docs/stack/search/reference/tags)
- [RediSearch](/docs/stack/search)

Feedback

If you've found issues on this page, or have suggestions for improvement, please submit a request to merge or open an issue in the repository.