Skip to main content
Documents in a search index are regular Redis keys. When a key matches an index prefix, it is indexed automatically. When the key changes, the index is updated automatically.
There is no separate update command for search. Use regular Redis write commands to change your data.
Any command that modifies a matching key updates the index. For example, this includes commands such as:
  • JSON commands such as JSON.SET, JSON.MERGE, …
  • Hash commands such as HSET, HINCRBY, …
  • String commands such as SET, SETEX, …
  • Generic commands such as DEL, EXPIRE, PEXPIRE, …
This is not an exhaustive list. The rule is that if the command changes a key tracked by the index, the index is updated. Index updates are batched for performance, so recent writes may not immediately appear in search results. Use SEARCH.WAITINDEXING when you need to ensure queries reflect recent changes.

JSON Documents

For JSON indexes, any JSON command that modifies a matching key updates the indexed document.

Hash Documents

For hash indexes, any hash command that modifies a matching key updates the indexed document.

String Documents

For string indexes, indexed keys must contain valid JSON strings. Any command that replaces or modifies the matching string key updates the indexed document.

Deletes

Deleting a matching key removes the document from the index.

Expiration

When a matching key expires, Upstash Redis Search removes the expired document from the index.

Eviction

When an indexed key is evicted, Upstash Redis Search removes the document from the index. Once the Redis key is gone, it no longer appears in search results.