Available in: Redis Stack
Time complexity: O(N) where N is the number of keys in the keyspace
FT.ALTER {index} SCHEMA ADD {attribute} {options} ...
Adds a new attribute to the index.
Adding an attribute to the index will cause any future document updates to use the new attribute when indexing and reindexing of existing documents.
!!! note
Depending on how the index was created, you may be limited by the number of additional text
attributes which can be added to an existing index. If the current index contains fewer than 32
text attributes, then SCHEMA ADD
will only be able to add attributes up to 32 total attributes (meaning that the
index will only ever be able to contain 32 total text attributes). If you wish for the index to
contain more than 32 attributes, create it with the MAXTEXTFIELDS
option.
FT.CREATE
for more information.[] otherwise.
redis> FT.ALTER idx SCHEMA ADD id2 NUMERIC SORTABLE
OK