FT.ALTER
Syntax
FT.ALTER {index} SCHEMA ADD {attribute} {options} ...
Time complexity: O(N) where N is the number of keys in the keyspace
ACL Categories: @ft_search, @slow, @write
Description
Add a new attribute to the index. The index can be referenced by its name or by an alias. Adding an attribute rebuilds the index: existing documents are reindexed with the new attribute, and later document updates use it too.
Required arguments
- The
indexparameter is the index name or alias to alter. - After the
SCHEMA ADDkeywords, declares which fields to add:attributeis an attribute to add.optionsare attribute options. Refer toFT.CREATEfor more information.
Return Values
- Simple string reply:
OKif executed correctly. - Simple error reply in these cases: no such index, invalid schema syntax.
Examples
dragonfly> FT.CREATE idx ON HASH SCHEMA id NUMERIC
OK
dragonfly> FT.ALTER idx SCHEMA ADD id2 NUMERIC SORTABLE
OK