younifyd
Menu

Search documents

Search documents

POST/namespaces/{namespace}/documents/search

Use it in a workflow

  1. Add a step and choose the Pinecone connector.
  2. Pick the Search documents action (under Data).
  3. Fill in the fields below, then reference the result from later steps as {{searchDocuments.response.data}}.

Request

Path parameters

namespacestringrequired

The namespace to search.

Request body

Enter the body as JSON in the step's Body field.

score_byarray<oneOf>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.

top_kinteger (int32)required

The number of top-ranked documents to return.

include_fieldsarray<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.

filterobject

A metadata filter expression to restrict the documents searched.

json
{
  "score_by": [
    null
  ],
  "top_k": 10,
  "include_fields": [
    "title",
    "content"
  ],
  "filter": {}
}

Response

Returns 200 with an object. Read it in later steps with {{searchDocuments.response.data.<field>}}.

matchesarray<object>

The matching documents, ordered from most to least similar.

_idstringrequired

The unique identifier of the matched document.

_scorenumber (float)required

The similarity score of the matched document. `null` when the score is not a finite number, which can happen for dense vectors of very large magnitude.

namespacestring

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

usageobject

Usage information for the `search_documents` operation.

read_unitsinteger (int32)required

The number of read units consumed by this operation.

egress_bytesinteger (int64)

The billed egress for this response, in bytes. Measured on the encoded response payload.

embed_total_tokensinteger (int32)

The number of tokens Pinecone embedded for the query text of an `embed` or `sparse_embed` scoring method. Present only when the search embedded query text.

json
{
  "matches": [
    {
      "_id": "doc-1",
      "_score": 0.9281134605407715,
      "content": "Machine learning is a subset of artificial intelligence.",
      "title": "Introduction to Machine Learning"
    }
  ],
  "namespace": "my-namespace",
  "usage": {
    "egress_bytes": 1024,
    "read_units": 5
  }
}

Need more? See the Pinecone guide for connection setup and behaviour shared by every action.

Search documents — Pinecone — Documentation