FT.TAGVALS
Syntax
FT.TAGVALS index field_name
- Available in:
- Redis Stack / Search 1.0.0
- Time complexity:
- O(N)
Return a distinct set of values indexed in a Tag field
Required arguments
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"