/aliases
Index aliases provide an indirection layer between your application and the actual index. You can point an alias to any index and swap it atomically, enabling zero-downtime reindexing.
How it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/aliases
Context preview
What this command does when you run it.
Index aliases provide an indirection layer between your application and the actual index. You can point an alias to any index and swap it atomically, enabling zero-downtime reindexing.
Command definition
aliases.mdAliases
Overview
Index aliases provide an indirection layer between your application and the actual index. You can point an alias to any index and swap it atomically, enabling zero-downtime reindexing.
Good For
- Zero-downtime index rebuilds (blue/green reindexing)
- A/B testing different index configurations
- Versioned index management
Examples
Add an Alias
import { Redis, s } from "@upstash/redis";
const redis = Redis.fromEnv();
// Create an index
const index = await redis.search.createIndex({
name: "products-v1",
prefix: "product:",
dataType: "json",
schema: s.object({ name: s.string(), price: s.number("F64") }),
});
// Add alias via the index instance
await index.addAlias({ alias: "products" });
// Or via the redis.search.alias API
await redis.search.alias.add({ indexName: "products-v1", alias: "products" });List All Aliases
const aliases = await redis.search.alias.list();
// { "products": "products-v1", "users": "users-v2" }Delete an Alias
await redis.search.alias.delete({ alias: "products" });
// Returns 1 if deleted, 0 if alias didn't existZero-Downtime Reindexing
// 1. Create new index with updated schema
const newIndex = await redis.search.createIndex({
name: "products-v2",
prefix: "product:",
dataType: "json",
schema: s.object({
name: s.string(),
price: s.number("F64"),
description: s.string(), // new field
}),
});
// 2. Wait for new index to finish scanning existing keys
await newIndex.waitIndexing();
// 3. Atomically swap the alias to the new index
// (addAlias updates the alias if it already exists)
await redis.search.alias.add({ indexName: "products-v2", alias: "products" });
// 4. Drop the old index
const oldIndex = redis.search.index({ name: "products" });
await oldIndex.drop();Read more
Aliases
Overview
Index aliases provide an indirection layer between your application and the actual index. You can point an alias to any index and swap it atomically, enabling zero-downtime reindexing.
Good For
- Zero-downtime index rebuilds (blue/green reindexing)
- A/B testing different index configurations
- Versioned index management
Examples
Add an Alias
import { Redis, s } from "@upstash/redis";
const redis = Redis.fromEnv();
// Create an index
const index = await redis.search.createIndex({
name: "products-v1",
prefix: "product:",
dataType: "json",
schema: s.object({ name: s.string(), price: s.number("F64") }),
});
// Add alias via the index instance
await index.addAlias({ alias: "products" });
// Or via the redis.search.alias API
await redis.search.alias.add({ indexName: "products-v1", alias: "products" });List All Aliases
const aliases = await redis.search.alias.list();
// { "products": "products-v1", "users": "users-v2" }Delete an Alias
await redis.search.alias.delete({ alias: "products" });
// Returns 1 if deleted, 0 if alias didn't existZero-Downtime Reindexing
// 1. Create new index with updated schema
const newIndex = await redis.search.createIndex({
name: "products-v2",
prefix: "product:",
dataType: "json",
schema: s.object({
name: s.string(),
price: s.number("F64"),
description: s.string(), // new field
}),
});
// 2. Wait for new index to finish scanning existing keys
await newIndex.waitIndexing();
// 3. Atomically swap the alias to the new index
// (addAlias updates the alias if it already exists)
await redis.search.alias.add({ indexName: "products-v2", alias: "products" });
// 4. Drop the old index
const oldIndex = redis.search.index({ name: "products" });
await oldIndex.drop();@upstash/redis is an HTTP/REST based Redis client for typescript, built on top of Upstash REST API. This project is in GA Stage. The Upstash Professional Support fully covers this project. It receives regular updates, and bug fixes.
Repo: upstash/redis-js
Other commands on redis-js.
- /aggregating
Run analytics over indexed data using metric and bucket aggregations. Compute statistics, group documents, build histograms, and perform faceted navigation. Aggregations can be nested for multi-level analysis.
Open command - /index-management
Create, inspect, and drop search indexes. Wait for indexing to complete after data changes. Indexes automatically track Redis keys matching a specified prefix.
Open command - /querying
Query documents from a search index using type-safe filters with support for pagination, sorting, field selection, scoring, and highlighting. Count matching documents efficiently without returning results.
Open command

