SEARCH.ALIASADD to create an alias or update an existing alias to point to a search index.
An alias is a stable name that queries can use in place of a real index name, so the index behind it can be replaced without touching application code. Pointing an existing alias at a different index is atomic, which is what makes zero-downtime reindexing possible: build the new index under a fresh name, then move the alias to it in one step.
See Aliases for feature examples, including zero-downtime index swaps.
The target name is not required to exist when the alias is created, so aliases can temporarily be dangling. Most commands resolve aliases, but SEARCH.DROP always uses a literal index name.
Syntax
Response
Returns1 if a new alias was created or 2 if an existing alias was updated, including when it already points to the supplied index.
Examples
Redis CLI
Redis CLI
@upstash/redis
@upstash/redis
upstash_redis
upstash_redis
ioredis
ioredis
node-redis
node-redis
curl
curl