> ## 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.LISTINDEXES

> List search indexes in the database.

Use `SEARCH.LISTINDEXES` to list search indexes in the database.

`MATCH` filters index names with a glob-style pattern, while `LIMIT` and `OFFSET` page through the reply, which keeps the command usable on a database with many indexes. Only index names are returned; use [`SEARCH.DESCRIBE`](/docs/redis/commands/search/search-describe) to see an index's schema and settings.

See [Listing Indexes](/docs/redis/search/index-management#listing-indexes) for the feature guide.

## Syntax

```redis theme={"system"}
SEARCH.LISTINDEXES [MATCH <pattern>] [LIMIT <count>] [OFFSET <offset>]
```

## Arguments

| Argument | Description | Default |
| - | - | - |
| `MATCH` | Filter index names by a glob-style pattern, such as `product*`. | All indexes |
| `LIMIT` | Maximum number of indexes to return. `0` returns all indexes. | `0` (all indexes) |
| `OFFSET` | Number of indexes to skip for pagination. | `0` |

## Response

Returns one entry per index, sorted by index name. Each entry is a map containing the index `name` and its backing `type` (`HASH`, `JSON`, `STRING`, or `STREAM`). With RESP2, each map is encoded as an array of alternating keys and values.

```text theme={"system"}
[
  ["name", "productIdx", "type", "HASH"],
  ["name", "profileIdx", "type", "JSON"],
  ["name", "sessionIdx", "type", "STRING"],
  ["name", "eventIdx", "type", "STREAM"]
]
```

## Examples

> [!NOTE]
>
> The high-level Search APIs do not currently expose `SEARCH.LISTINDEXES`. Use each client's generic command method for this command.

> **Redis CLI**
>
> ```bash theme={"system"}
> SEARCH.LISTINDEXES MATCH 'product*' LIMIT 10 OFFSET 0
> ```

> **@upstash/redis**
>
> ```ts theme={"system"}
> import { Redis } from "@upstash/redis";
>
> const redis = Redis.fromEnv();
> const indexes = await redis.exec<string[][]>([
>   "SEARCH.LISTINDEXES",
>   "MATCH",
>   "product*",
>   "LIMIT",
>   10,
>   "OFFSET",
>   0,
> ]);
> ```

> **upstash\_redis**
>
> ```python theme={"system"}
> from upstash_redis import Redis
>
> redis = Redis.from_env()
> indexes = redis.execute([
>     "SEARCH.LISTINDEXES",
>     "MATCH",
>     "product*",
>     "LIMIT",
>     10,
>     "OFFSET",
>     0,
> ])
> ```

> **ioredis**
>
> ```ts theme={"system"}
> import IORedis from "ioredis";
>
> const redis = new IORedis(process.env.REDIS_URL!);
> const indexes = await redis.call(
>   "SEARCH.LISTINDEXES",
>   "MATCH",
>   "product*",
>   "LIMIT",
>   10,
>   "OFFSET",
>   0,
> );
> ```

> **node-redis**
>
> ```ts theme={"system"}
> import { createClient } from "redis";
>
> const client = await createClient({ url: process.env.REDIS_URL })
>   .on("error", console.error)
>   .connect();
> const indexes = await client.sendCommand([
>   "SEARCH.LISTINDEXES",
>   "MATCH",
>   "product*",
>   "LIMIT",
>   "10",
>   "OFFSET",
>   "0",
> ]);
> ```

> **redis-py**
>
> ```python theme={"system"}
> import os
> import redis
>
> client = redis.from_url(os.environ["REDIS_URL"])
> result = client.execute_command(
>     "SEARCH.LISTINDEXES",
>     "MATCH",
>     "product*",
>     "LIMIT",
>     "10",
>     "OFFSET",
>     "0",
> )
> print(result)
> ```

> **go-redis**
>
> ```go theme={"system"}
> package main
>
> import (
>     "context"
>     "fmt"
>     "os"
>
>     "github.com/redis/go-redis/v9"
> )
>
> func main() {
>     opts, err := redis.ParseURL(os.Getenv("REDIS_URL"))
>     if err != nil {
>         panic(err)
>     }
>     client := redis.NewClient(opts)
>     result, err := client.Do(
>         context.Background(),
>         "SEARCH.LISTINDEXES",
>         "MATCH",
>         "product*",
>         "LIMIT",
>         "10",
>         "OFFSET",
>         "0",
>     ).Result()
>     if err != nil {
>         panic(err)
>     }
>     fmt.Println(result)
> }
> ```

> **jedis**
>
> ```java theme={"system"}
> import java.net.URI;
>
> import redis.clients.jedis.Jedis;
>
> try (Jedis jedis = new Jedis(new URI(System.getenv("REDIS_URL")))) {
>   Object result = jedis.sendCommand(
>       () -> "SEARCH.LISTINDEXES".getBytes(),
>       "MATCH",
>       "product*",
>       "LIMIT",
>       "10",
>       "OFFSET",
>       "0"
>   );
>   System.out.println(result);
> }
> ```

> **redis-rs**
>
> ```rust theme={"system"}
> fn main() -> redis::RedisResult<()> {
>     let url = std::env::var("REDIS_URL").expect("REDIS_URL is not set");
>     let client = redis::Client::open(url)?;
>     let mut connection = client.get_connection()?;
>
>     let mut command = redis::cmd("SEARCH.LISTINDEXES");
>     command.arg("MATCH");
>     command.arg("product*");
>     command.arg("LIMIT");
>     command.arg("10");
>     command.arg("OFFSET");
>     command.arg("0");
>     let result: redis::Value = command.query(&mut connection)?;
>     println!("{result:?}");
>     Ok(())
> }
> ```

> **curl**
>
> ```bash theme={"system"}
> curl -X POST https://YOUR_ENDPOINT.upstash.io \
>   -H "Authorization: Bearer $UPSTASH_REDIS_REST_TOKEN" \
>   -d '["SEARCH.LISTINDEXES", "MATCH", "product*", "LIMIT", "10", "OFFSET", "0"]'
> ```


## Related topics

- [Indices](/docs/redis/search/index-management.md)
- [SEARCH.LISTALIASES](/docs/redis/commands/search/search-listaliases.md)
- [Search](/docs/search/sdks/ts/commands/search.md)
- [Indexes](/docs/search/features/indexes.md)


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