Upstash Documentation

SEARCH.REINDEX

Rebuild a search index from the current matching data.
1 min read

Use SEARCH.REINDEX to rebuild an existing index from the current Redis keys that match its data type and prefixes. It is especially useful after creating an index with SKIPINITIALSCAN.

See Index Management for the feature guide to creating and managing indexes.

SEARCH.REINDEX accepts an index name or alias. The index definition is preserved while its searchable contents are replaced with a fresh scan.

Warning

Reindexing scans all matching keys and can be expensive for large datasets.

Syntax#

Response#

Returns 1 when the index is rebuilt or 0 if the index does not exist.

Examples#

Redis CLI
@upstash/redis
Note

This command is not supported yet in @upstash/redis.

upstash_redis
Note

This command is not supported yet in upstash_redis.

ioredis
node-redis
redis-py
go-redis
jedis
redis-rs
curl