content/commands/ft.alter.md
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.
is index name to create.
</details> <details open> <summary><code>SKIPINITIALSCAN</code></summary>if set, does not scan and index.
</details> <details open> <summary><code>SCHEMA ADD {attribute} {options} ...</code></summary>after the SCHEMA keyword, declares which fields to add:
attribute is attribute to add.options are attribute options. Refer to [FT.CREATE]({{< relref "commands/ft.create/" >}}) for more information.<note><b>Note:</b>
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.
</note>
{{< highlight bash >}} 127.0.0.1:6379> FT.ALTER idx SCHEMA ADD id2 NUMERIC SORTABLE OK {{< / highlight >}}
</details>| Redis Software | Redis Cloud Flexible & Annual | Redis Cloud Free & Fixed | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:-----------------|:------| | <span title="Supported">✅ Supported</span> | <span title="Supported">✅ Supported</span> | <span title="Supported">✅ Supported</nobr></span> | |
{{< multitabs id="ft-alter-return-info" tab1="RESP2" tab2="RESP3" >}}
One of the following:
OK if executed correctly.-tab-sep-
One of the following:
OK if executed correctly.{{< /multitabs >}}
[FT.CREATE]({{< relref "commands/ft.create/" >}})