Skip to main content
POST
Filters apply before scoring, so only documents that match the filter are ranked. For how each scoring type works and how to combine them, see Full-text search and the query syntax reference.

Authorizations

Api-Key
string
header
required

An API Key is required to call Pinecone APIs. Get yours from the console.

Headers

X-Pinecone-Api-Version
string
default:2026-07
required

Required date-based version header

Path Parameters

namespace
string
required

The namespace to search.

Body

application/json

The request for the search_documents operation.

score_by
(Dense vector · object | Sparse vector · object | Text · object | Query string · object | Embed · object | Sparse embed · object)[]
required

The scoring clauses used to rank documents.

One clause of any type is always valid. Several clauses can be combined only when every clause is text or query_string, and the server combines them into one ranking. A dense_vector, sparse_vector, embed, or sparse_embed clause must be the only clause.

Required array length: 1 - 100 elements

A scoring clause that defines how documents are scored against a query. type selects the scoring method and which other fields the clause takes.

top_k
integer<int32>
required

The number of top-ranked documents to return.

Required range: 1 <= x <= 10000
Example:

10

include_fields
string[]

The document fields to return on each match alongside _id and _score. When omitted or empty, no fields are returned. Pass ["*"] to return every field. A name the schema doesn't declare is read as a metadata key, and returns nothing for documents without that key.

Naming a field whose schema sets store_text: false is rejected with 400, since its text is not stored; ["*"] leaves such fields out.

Example:
filter
object

A metadata filter expression to restrict the documents searched.

Response

A successful search response.

The response for the search_documents operation.

matches
object[]
required

The matching documents, ordered from most to least similar.

namespace
string
required

The namespace that served the search: the request's namespace, or the alias's target namespace when the request named a namespace alias.

Example:

"my-namespace"

usage
object
required

Usage information for the search_documents operation.

Example: