> ## Documentation Index
> Fetch the complete documentation index at: https://upstash.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# SEARCH.REINDEX

> Rebuild a search index from the current matching data.

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](/docs/redis/search/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.
</Warning>

## Syntax

```redis theme={"system"}
SEARCH.REINDEX <name>
```

## Response

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

## Examples

<AccordionGroup>
  <Accordion title="Redis CLI" icon="terminal">
    ```bash theme={"system"}
    SEARCH.REINDEX products
    ```
  </Accordion>

  <Accordion title="curl">
    ```bash theme={"system"}
    curl -X POST https://YOUR_ENDPOINT.upstash.io \
      -H "Authorization: Bearer $UPSTASH_REDIS_REST_TOKEN" \
      -d '["SEARCH.REINDEX", "products"]'
    ```
  </Accordion>
</AccordionGroup>


## Related topics

- [SEARCH.CREATE](/docs/redis/commands/search/search-create.md)
- [Search commands](/docs/redis/commands/search/overview.md)
- [Indices](/docs/redis/search/index-management.md)
- [Search](/docs/search/sdks/ts/commands/search.md)
