> ## 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 commands

> Commands for creating, querying, and managing Upstash Redis Search indexes.

> [!NOTE]
>
> Upstash Redis Search uses `SEARCH.*` commands. They are separate from and incompatible with the `FT.*` commands in the open-source RediSearch module.

For Search commands, use the Upstash [`@upstash/redis`](https://upstash.com/docs/redis/sdks/ts/overview) or [`upstash-redis`](https://upstash.com/docs/redis/sdks/py/overview) SDK,
or the redis-js wrappers [`@upstash/search-redis`](https://upstash.com/docs/redis/search/adapters/node-redis) for node-redis and [`@upstash/search-ioredis`](https://upstash.com/docs/redis/search/adapters/ioredis) for ioredis.

For feature guides and tutorials, start with the [Upstash Redis Search introduction](https://upstash.com/docs/redis/search/introduction).

> [card] [SEARCH.CREATE](https://upstash.com/docs/redis/commands/search/search-create)
>
> Create a search index

> [card] [SEARCH.DROP](https://upstash.com/docs/redis/commands/search/search-drop)
>
> Remove a search index

> [card] [SEARCH.DESCRIBE](https://upstash.com/docs/redis/commands/search/search-describe)
>
> Return metadata about a search index

> [card] [SEARCH.WAITINDEXING](https://upstash.com/docs/redis/commands/search/search-waitindexing)
>
> Wait until pending index updates are visible

> [card] [SEARCH.LISTINDEXES](https://upstash.com/docs/redis/commands/search/search-listindexes)
>
> List search indexes in the database

> [card] [SEARCH.QUERY](https://upstash.com/docs/redis/commands/search/search-query)
>
> Search documents with a JSON filter

> [card] [SEARCH.COUNT](https://upstash.com/docs/redis/commands/search/search-count)
>
> Count matching documents

> [card] [SEARCH.AGGREGATE](https://upstash.com/docs/redis/commands/search/search-aggregate)
>
> Compute analytics over matching documents

> [card] [SEARCH.ALIASADD](https://upstash.com/docs/redis/commands/search/search-aliasadd)
>
> Add or update an index alias

> [card] [SEARCH.ALIASDEL](https://upstash.com/docs/redis/commands/search/search-aliasdel)
>
> Remove an index alias

> [card] [SEARCH.LISTALIASES](https://upstash.com/docs/redis/commands/search/search-listaliases)
>
> List index aliases

`SEARCH.QUERY`, `SEARCH.COUNT`, `SEARCH.AGGREGATE`, `SEARCH.DESCRIBE`, and `SEARCH.WAITINDEXING` accept either an index name or alias. `SEARCH.DROP` always treats its argument as a literal index name. This makes it possible to switch an alias to a replacement index and then drop the old index without dropping the replacement.

## REST API Usage

All search commands can be sent via the Upstash REST API using a JSON array POST body.
Each element of the array corresponds to a token in the command.

```bash theme={"system"}
curl -X POST https://YOUR_ENDPOINT.upstash.io \
  -H "Authorization: Bearer $UPSTASH_REDIS_REST_TOKEN" \
  -d '["COMMAND", "arg1", "arg2", ...]'
```

The JSON filter and aggregation arguments are passed as string values within the array (not as nested JSON objects):

```bash theme={"system"}
# Correct — filter is a string inside the array
["SEARCH.QUERY", "products", "{\"name\": \"wireless\"}", "LIMIT", "10"]

# Incorrect — filter is a nested object
["SEARCH.QUERY", "products", {"name": "wireless"}, "LIMIT", "10"]
```

Pass JSON filter and aggregation arguments as string values inside the array, not as nested JSON objects.
Search commands also work through the `/pipeline` endpoint for batching multiple commands in a single HTTP request.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.