Aliases API
Aliases let clients address a collection by a stable name that can be moved to a different target collection later. This is useful for zero-downtime reindexing, versioned collections, and tenant-specific views.
Routes
| Method | Endpoint | Purpose |
|---|---|---|
| GET | /aliases | List all aliases |
| GET | /collections/{collection}/aliases | List aliases that target a collection |
| POST/PUT | /aliases/{alias} | Create or update an alias |
| GET | /aliases/{alias} | Get one alias |
| DELETE | /aliases/{alias} | Delete an alias |
List Aliases
curl http://localhost:9200/aliases
Example response:
{
"aliases": [
{
"name": "products_live",
"collection_name": "products_v2"
}
]
}
List Aliases for a Collection
curl http://localhost:9200/collections/products_v2/aliases
The same filtering can also be requested with the collection query parameter:
curl "http://localhost:9200/aliases?collection=products_v2"
Create or Update Alias
Endpoint: POST /aliases/{alias} or PUT /aliases/{alias}
Request body accepts collection_name or collection:
curl -X PUT http://localhost:9200/aliases/products_live \
-H "Content-Type: application/json" \
-d '{"collection_name":"products_v2"}'
Alternative body:
{
"collection": "products_v2"
}
The target collection must already exist.
Get Alias
curl http://localhost:9200/aliases/products_live
Delete Alias
curl -X DELETE http://localhost:9200/aliases/products_live
Reindexing Pattern
- Create
products_v2with the new schema. - Import or backfill documents into
products_v2. - Validate searches against
products_v2. - Move the alias:
curl -X PUT http://localhost:9200/aliases/products_live \
-H "Content-Type: application/json" \
-d '{"collection_name":"products_v2"}'
- Delete the old collection after consumers have moved past it.