Search for documents in a namespace using one or more scoring methods (dense vector, sparse vector, text, or query string similarity).
Returns the top-k most similar documents along with their scores and requested fields.
Documentation Index
Fetch the complete documentation index at: https://docs.pinecone.io/llms.txt
Use this file to discover all available pages before exploring further.
202601-alpha. APIs may continue to evolve before general availability.score_by array selecting one of the following scoring types:
type: "text" — BM25 token matching on a single text field. Multi-word queries use OR-style matching (case-insensitive). For exact-phrase ranking, use query_string with quoted terms.type: "query_string" — Lucene query syntax. Supports boolean operators, phrase prefix matching, boosting, and cross-field queries. See the query syntax reference.type: "dense_vector" — dense vector similarity ranking against a dense_vector field.type: "sparse_vector" — sparse vector similarity ranking against a sparse_vector field.$match_phrase / $match_all / $match_any and logical operators $and / $or / $not). Filters are applied before scoring — the search only considers documents that match the filter. Scoring-only operators — phrase slop ("phrase"~N), term boosting (^N), and phrase prefix ("phrase pre"*) — are available in query_string scoring but cannot be used inside filter.
include_fields defaults to [] (returns only _id and _score); use ["*"] to return all stored fields.
text clauses (one per field) or a single query_string clause whose query targets several fields, and every contributing field weighs equally in 202601-alpha; there is no per-clause weight parameter. To combine BM25 ranking with dense_vector or sparse_vector ranking, restrict the dense (or sparse) search with a text-match filter ($match_phrase, $match_all, $match_any) on the lexical field, or run separate searches and merge the results client-side.Required date-based version header
The namespace to search.
The request for the search_documents operation.
The list of scoring methods to use for ranking documents.
1 - 100 elementsThe number of top-ranked documents to return.
1 <= x <= 1000010
The document fields to include in the search results.
["title", "content"]A metadata filter expression to restrict the documents searched.
A successful search response.
The response for the search_documents operation.