Add a distance index
POST/pipelines/:pipeline_id/search-indexers/:indexer_id/distance-indexes
Adds a distance index for cosine, euclidean-distance or dot-product to a vector index, so that searches can use that distance strategy. The database builds the index in the background with a concurrent build, so searches and document processing continue. The response returns as soon as the build starts: the new entry of the distance index list shows valid set to false until the build completes, and the rebuild field of the search index reports the progress. The max-inner-product strategy cannot be indexed.
Permissions. Write on the pipeline.
Distance index shows the requests.
Request
Responses
- 202
- 400
- 401
- 404
- 409
- 422
The build started. The body holds the identifier of the search index, the distance strategy and the name of the database index under construction.
The identifier names a full-text or BM25 index (Invalid parameter, with Search indexer <id> is not a vector indexer in details.error), or distance is max-inner-product (Invalid parameter, with The MaxInnerProduct distance cannot be indexed).
The authentication headers are missing or invalid, or the API key is inactive or expired. Errors lists the messages.
No pipeline with this identifier exists or the key lacks write permission on the pipeline (Pipeline with id <id> not found), or the pipeline has no search index with this identifier (Search Indexer with id <id> not found).
The vector index already has a valid distance index for the strategy (Conflict, with Search indexer <id> already has an index for the <distance> distance in details.error), or a rebuild or a distance index build is running on the search index (Conflict, with The indexes of search indexer <id> are already being built or rebuilt).
distance is missing or is not a distance strategy. The response body is plain text (Failed to deserialize the JSON body into the target type: ...).