FT.ALTER

Syntax
FT.ALTER {index} [SKIPINITIALSCAN] SCHEMA ADD {attribute} {options} ...
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.

Examples

Required arguments

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:

  • attribute is attribute to add.
  • options are attribute options. Refer to FT.CREATE for more information.

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.

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
OK

See also

FT.CREATE

Rate this page