FT.ALTER
Syntax
FT.ALTER {index} [SKIPINITIALSCAN] SCHEMA ADD {attribute} {options} ...
Time complexity: O(N) where N is the number of keys in the keyspace
ACL Categories: @search
Description
Add a new attribute to the index. Note that adding an attribute to the index causes any future document updates to use the new attribute when indexing and reindexing existing documents.
Required arguments
- The
indexparameter is the index name to alter. - The
SKIPINITIALSCANoption: if set, the command does not scan and index. - 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.ALTER idx SCHEMA ADD id2 NUMERIC SORTABLE
OK