Skip to content

Index Management

Nikita Ganzikov edited this page Jan 6, 2026 · 1 revision

Index Management

Indexes are containers for your documents. Each index has a unique ID and a primary key field.

Create Index

Creates a new search index.

Endpoint: POST /indexes

Query Parameters:

  • id (required) - Unique identifier for the index
  • primaryKey (optional) - Field name to use as primary key (default: "id")

Example:

curl -X POST "http://localhost:3000/indexes?id=products&primaryKey=sku"

Response: 201 Created

{
  "id": "products",
  "primaryKey": "sku"
}

Update Index

Updates index configuration.

Endpoint: PATCH /indexes/:id

Request Body:

{
  "primaryKey": "newPrimaryKey"
}

Example:

curl -X PATCH "http://localhost:3000/indexes/products" \
  -H "Content-Type: application/json" \
  -d '{"primaryKey": "id"}'

Response: 200 OK

{
  "id": "products",
  "primaryKey": "id"
}

Delete Index

Deletes an index and all its documents.

Endpoint: DELETE /indexes/:id

Example:

curl -X DELETE "http://localhost:3000/indexes/products"

Response: 204 No Content

Notes

  • Index IDs must be unique
  • Deleting an index removes all associated documents permanently
  • Indexes are persisted to disk and automatically recovered on server restart

Clone this wiki locally