Search a pipeline
POST/pipelines/:pipeline_id/search
Runs one similarity, maximal marginal relevance (MMR), full-text, hybrid or history search on a pipeline and returns the matching fragments as a JSON array, without the list envelope. The request body names the search text, the reader's classifications, the search type with the parameters of the type, an optional path pattern and an optional metadata filter. Each search type reads the search index named in params or the pipeline's default index of the required kind, and a search without path covers only the documents without a path.
Permissions. Read and execute on the pipeline, and a classification allow-list that covers every classification that the request names.
Search requests describes every field, the search types, the response and the errors.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 409
- 422
- 500
The body is an array of fragments, which can be empty. Similarity and MMR results are ordered by ascending distance, full-text and hybrid results by descending score, and history results by document version, newest first.
A search index or a distance strategy cannot be used (Invalid parameter, with the reason in details.error), for example because the pipeline has no default index of the required kind, the named index is not an index of the required kind in the pipeline, or the vector index has no distance index for the strategy. A search parameter is out of range (Invalid parameter, such as `k` must be greater than 0): k or fetch_k is 0, fetch_k is smaller than k, or lambda_mult lies outside 0 to 1. params contains a parameter of an earlier release, embedding or search_type, and the message names the replacement. The body holds a top-level field that the request does not define (Unknown field `<name>` , with the accepted fields in details.expected), the request sets type to query (Invalid search type or parameters), or the filter does not match the pipeline's metadata schema (Schema error). Search requests lists each message.
The authentication headers are missing or invalid, or the API key is inactive or expired. Errors lists the messages.
A named classification that the pipeline defines is outside the classification allow-list of the key, or the key has an empty allow-list (Unauthorized: execute access to Pipeline required, with the classification named in details.error).
No pipeline with this identifier exists or the key lacks read and execute permission on the pipeline (Pipeline not found), or search_type of the classification object is 1 or 3 and a named classification is not defined in the pipeline (Classification not found).
The search index, or the distance index of the distance strategy, is still being built, or the search index failed to build (Conflict, with the reason in details.error).
The body does not match the request schema (Failed to deserialize the JSON body: ...), for example a missing required field, an unknown type or distance_strategy value, an unknown key in params such as threshold in a hybrid search, a search_type other than 1, 2 or 3 in the classification object, a path that is not a valid path pattern or a filter that does not follow the filter grammar.
The embedding model could not convert the query into a vector, the query language could not be detected, or the database rejected the query (Internal server error). The API server log records the cause.