/v1/namespaces/{name}/indexREAD / WRITEConfigure a collection's index
Build, replace, or drop the ANN index for one collection. Asynchronous.
One endpoint, three effects — there is no separate "change" operation in
the contract, it's the same request shape with a different type:
- Create or replace: send
type: "hnsw" | "ivf" | "bq". If an index already exists, the current one keeps serving searches while the new one builds in the background. - Drop: send
type: null. Reverts the collection to exact (brute-force) search — no dedicated ANN structure.
A build is asynchronous: 202 means the build started, and the
response carries the building generation. Poll Collection index
state until status settles.
Only hnsw, ivf, and bq are buildable per collection — narrower than
the project-wide rebuild's brute/auto
options, which are project-level selections, not per-collection ANN
structures. Sending one of those here is a 400 invalid_index error, not
silently accepted.
Parameters
namestringrequiredCollection name (path parameter).
Request body
typestringoptional"hnsw", "ivf", "bq", or null to drop the index. Omitting the
field entirely behaves the same as null.
parametersobjectoptionalOptional tuning overrides. Unknown keys are ignored, not rejected — the contract only names the five keys the build actually reads.
parameters.mintegeroptionalparameters.ef_constructionintegeroptionalparameters.ef_searchintegeroptionalparameters.n_listintegeroptionalmax(16, sqrt(N)).parameters.n_probeintegeroptionalmax(1, sqrt(n_list)).Response fields
Same shape as Collection index state — see that page's response fields.
Errors
| Status | code | Meaning |
|---|---|---|
400 | invalid_index | type isn't one of hnsw/ivf/bq/null — e.g. sending brute or auto, which are project-level, not per-collection. |
401 | unauthorized | Missing or invalid API key. |
403 | forbidden | The key's scope doesn't include read_write. |
404 | collection_not_found | No such collection. |
409 | conflict | A build is already in progress for this collection. |
501 | not_implemented | ANN index management is unavailable on this node. |
Related endpoints
- Collection index state — poll this after a
202 - Rebuild all indexes — project-wide, synchronous alternative