Add a search index
POST/pipelines/:pipeline_id/search-indexers
Adds a search index to a pipeline: a vector index on VectorChord (vchord) or pgvector (pgvector) for an embedding model, the full-text index (fts) or a BM25 index (bm25) with a tokenizer. A pipeline holds one full-text index, one BM25 index for each distinct tokenizer and one vector index for each embedding model and extension.
An index added to a pipeline that holds fragments starts as building, and the workers fill the index from the stored fragment text in the background, so no document is submitted again. An index added to a pipeline without fragments is ready at once. A new vector index has a distance index for cosine. An added index does not become a default: PUT /pipelines/{pipeline_id}/search-indexers/{indexer_id}/default makes a ready index the default of its kind.
The request waits up to 10 seconds for document processing on the pipeline to pause, and returns HTTP 409 when processing does not pause in that time.
Permissions. Read and write on the pipeline. A vector index also requires read and write on the embedding model.
Add, rebuild or switch a search index shows the requests, and BM25 tokenizers lists the options of a tokenizer.
Request
Responses
- 201
- 400
- 401
- 404
- 409
- 422
The index was added. The body is the new index, with status set to building when the pipeline holds fragments and to ready otherwise, and is_default set to false.
The tokenizer of a BM25 index is invalid, or the tokenizer of a Hugging Face model could not be downloaded (Invalid parameter). details.error holds the reason, as listed in BM25 tokenizers.
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 embedding model of a vector index does not exist or the key lacks read and write permission on the embedding model (Embedding Model with id <id> not found).
The pipeline already has such an index, or document processing on the pipeline did not pause within 10 seconds (Conflict). details.error names the conflict, such as The pipeline already has a BM25 indexer with this tokenizer or The pipeline is busy processing documents, try again shortly. Errors lists the messages.
The body does not match the request schema, for example an unknown type, a vector index without embedding_model_id, or a tokenizer with an unknown field or option value. The response body is plain text (Failed to deserialize the JSON body into the target type: ...).