# 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`](/redis/commands/search/search-describe) to see an index's schema and settings.

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

## Syntax

```redis
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`, or `STRING`). With RESP2, each map is encoded as an array of alternating keys and values.

```text
[
  ["name", "productIdx", "type", "HASH"],
  ["name", "profileIdx", "type", "JSON"],
  ["name", "sessionIdx", "type", "STRING"]
]
```

## Examples

<Note>
  The high-level Search APIs do not currently expose `SEARCH.LISTINDEXES`. Use each client's generic command method for this command.
</Note>

<AccordionGroup>

<Accordion title="Redis CLI" icon="terminal">

```bash
SEARCH.LISTINDEXES MATCH 'product*' LIMIT 10 OFFSET 0
```

</Accordion>

<Accordion title="@upstash/redis" icon="node-js" iconType="brands">

```ts
import { Redis } from "@upstash/redis";

const redis = Redis.fromEnv();
const indexes = await redis.exec<string[][]>([
  "SEARCH.LISTINDEXES",
  "MATCH",
  "product*",
  "LIMIT",
  10,
  "OFFSET",
  0,
]);
```

</Accordion>

<Accordion title="upstash_redis" icon="python" iconType="brands">

```python
from upstash_redis import Redis

redis = Redis.from_env()
indexes = redis.execute([
    "SEARCH.LISTINDEXES",
    "MATCH",
    "product*",
    "LIMIT",
    10,
    "OFFSET",
    0,
])
```

</Accordion>

<Accordion title="ioredis" icon="node-js" iconType="brands">

```ts
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,
);
```

</Accordion>

<Accordion title="node-redis" icon="node-js" iconType="brands">

```ts
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",
]);
```

</Accordion>

<Accordion title="curl">

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

</Accordion>

</AccordionGroup>
