FT.ALTER
- Available in:
- Redis Stack / Search 1.0.0
- Time complexity:
- O(N) where N is the number of keys in the keyspace
Add a new attribute to the index. Adding an attribute to the index causes any future document updates to use the new attribute when indexing and reindexing existing documents.
Syntax
FT.ALTER {index} [SKIPINITIALSCAN] SCHEMA ADD {attribute} {options} ...Required parameters
index
is index name to create.
SKIPINITIALSCAN
if set, does not scan and index.
SCHEMA ADD {attribute} {options} ...
after the SCHEMA keyword, declares which fields to add:
attributeis attribute to add.optionsare attribute options. Refer toFT.CREATEfor more information.
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.
Return
FT.CREATE returns a simple string reply OK if executed correctly, or an error reply otherwise.
Examples
Alter an index
127.0.0.1:6379> FT.ALTER idx SCHEMA ADD id2 NUMERIC SORTABLE
OKSee also
Related topics
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.