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

> Return metadata about a search index.

Use `SEARCH.DESCRIBE` to return metadata about a search index.

The reply reports how the index is defined, the key type and prefixes it covers, and the fields in its schema with their types and options, along with its current state such as the number of indexed documents. It is the way to confirm what an index actually indexes before writing queries against it, and to check whether a schema change was applied.

See [Describing an Index](/docs/redis/search/index-management#describing-an-index) for the feature guide.

The command accepts an index name or alias. When an alias is used, the response describes its target and reports the target's index name.

## Syntax

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

## Response

Returns index metadata as alternating field names and values. The response contains:

| Field | Description |
| - | - |
| `name` | The index name. |
| `type` | The indexed Redis value type: `HASH`, `JSON`, `STRING`, or `STREAM`. |
| `prefixes` | Key prefixes included in the index. For a `STREAM` index, the single stream key it covers. |
| `language` | Stemming language used by `TEXT` fields. |
| `indexSize` | Current index size in bytes. |
| `pendingUpdates` | Number of updates waiting to be indexed. |
| `schema` | Field definitions, including `FROM`, `NOSTEM`, `NOTOKENIZE`, and `FAST` options where present. |

```text theme={"system"}
[
  "name", "products",
  "type", "JSON",
  "prefixes", ["product:"],
  "language", "english",
  "indexSize", 1234,
  "pendingUpdates", 0,
  "schema", [["name", "TEXT"], ["price", "F64", "FAST"]]
]
```

Returns `null` if the index does not exist.

## Examples

> **Redis CLI**
>
> ```bash theme={"system"}
> SEARCH.DESCRIBE products
> ```

> **@upstash/redis**
>
> ```ts theme={"system"}
> import { Redis } from "@upstash/redis";
>
> const redis = Redis.fromEnv();
> const products = redis.search.index({ name: "products" });
> const description = await products.describe();
> ```

> **upstash\_redis**
>
> ```python theme={"system"}
> from upstash_redis import Redis
>
> redis = Redis.from_env()
> products = redis.search.index(name="products")
> description = products.describe()
> ```

> **ioredis**
>
> ```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 products = search.index({ name: "products" });
> const description = await products.describe();
> ```

> **node-redis**
>
> ```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 products = search.index({ name: "products" });
> const description = await products.describe();
> ```

> **redis-py**
>
> ```python theme={"system"}
> import os
> import redis
>
> client = redis.from_url(os.environ["REDIS_URL"])
> result = client.execute_command("SEARCH.DESCRIBE", "products")
> 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.DESCRIBE", "products").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.DESCRIBE".getBytes(), "products");
>   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.DESCRIBE");
>     command.arg("products");
>     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.DESCRIBE", "products"]'
> ```


## Related topics

- [SEARCH.LISTINDEXES](/docs/redis/commands/search/search-listindexes.md)
- [Indices](/docs/redis/search/index-management.md)
- [Search commands](/docs/redis/commands/search/overview.md)
- [Changelog](/docs/redis/overall/changelog.md)
- [SEARCH.AGGREGATE](/docs/redis/commands/search/search-aggregate.md)


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