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

> Drop a search index without deleting its keys.

Use `SEARCH.DROP` to remove a search index. The underlying Redis keys are not deleted.

Only the index and its internal structures go away, so the documents themselves stay exactly as they are and can be indexed again later by creating a new index over the same prefixes. Queries against the dropped name fail from then on.

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

`SEARCH.DROP` does not resolve aliases: `<name>` is always treated as the literal index name. Aliases that point to a dropped index are not removed automatically.

## Syntax

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

## Response

Returns `1` if the index was dropped or `0` if the index was not found.

## Examples

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

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

    const redis = Redis.fromEnv();
    const products = redis.search.index({ name: "products" });
    const result = await products.drop();
    ```
  </Accordion>

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

    redis = Redis.from_env()
    products = redis.search.index(name="products")
    result = products.drop()
    ```
  </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 products = search.index({ name: "products" });
    const result = await products.drop();
    ```
  </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 products = search.index({ name: "products" });
    const result = await products.drop();
    ```
  </Accordion>

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


## Related topics

- [Indices](/docs/redis/search/index-management.md)
- [Aliases](/docs/redis/search/aliases.md)
- [Troubleshooting](/docs/redis/search/troubleshooting.md)
- [Search commands](/docs/redis/commands/search/overview.md)
- [SEARCH.ALIASADD](/docs/redis/commands/search/search-aliasadd.md)
