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

> List search index aliases.

Use `SEARCH.LISTALIASES` to return all aliases and the indexes they point to.

The reply pairs each alias with its target index name, which is how you check what an alias currently resolves to before or after swapping it. Aliases whose target no longer exists are still listed, since an alias may point at a name that has not been created yet.

See [Listing Aliases](/docs/redis/search/aliases#listing-aliases) for the feature guide.

## Syntax

```redis theme={"system"}
SEARCH.LISTALIASES
```

## Response

Returns an unordered array of `[alias, index_name]` pairs, or an empty array if no aliases exist. The response can include aliases whose target index no longer exists. To list every index in the database, use [`SEARCH.LISTINDEXES`](/docs/redis/commands/search/search-listindexes).

The SDKs below decode the pairs into an object or dictionary that maps each alias to its index name.

## Examples

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

  <Accordion title="@upstash/redis" icon="node-js" iconType="brands">
    ```ts theme={"system"}
    import { Redis } from "@upstash/redis";

    const redis = Redis.fromEnv();
    const aliases = await redis.search.alias.list();
    // { products: "products-v2" }
    ```
  </Accordion>

  <Accordion title="upstash_redis" icon="python" iconType="brands">
    ```python theme={"system"}
    from upstash_redis import Redis

    redis = Redis.from_env()
    aliases = redis.search.alias.list()
    # {"products": "products-v2"}
    ```
  </Accordion>

  <Accordion title="ioredis" icon="node-js" iconType="brands">
    ```ts theme={"system"}
    import IORedis from "ioredis";
    import { createSearch } from "@upstash/search-ioredis";

    const redis = new IORedis(process.env.REDIS_URL!);
    const search = createSearch(redis);
    const aliases = await search.alias.list();
    // { products: "products-v2" }
    ```
  </Accordion>

  <Accordion title="node-redis" icon="node-js" iconType="brands">
    ```ts theme={"system"}
    import { createClient } from "redis";
    import { createSearch } from "@upstash/search-redis";

    const client = await createClient({ url: process.env.REDIS_URL })
      .on("error", console.error)
      .connect();
    const search = createSearch(client);
    const aliases = await search.alias.list();
    // { products: "products-v2" }
    ```
  </Accordion>

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


## Related topics

- [Aliases](/docs/redis/search/aliases.md)
- [Changelog](/docs/redis/overall/changelog.md)
- [Search](/docs/search/sdks/ts/commands/search.md)
- [Search commands](/docs/redis/commands/search/overview.md)
