younifyd
Menu

Post Embeddings Index Query Dataset Indexname

Query an embeddings index

POST/embeddings-index/query/{dataset}/{indexName}

Use it in a workflow

  1. Add a step and choose the Sanity connector.
  2. Pick the Post Embeddings Index Query Dataset Indexname action (under Embeddings Index).
  3. Fill in the fields below, then reference the result from later steps as {{postEmbeddingsIndexQueryDatasetIndexname.response.data}}.

Request

Path parameters

datasetstringrequired

The name of the dataset where you want to query the embeddings index

indexNamestringrequired

The name of the embeddings index you want to query

Request body

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

querystringrequired

The text string used to query the embeddings index

maxResultsinteger

Max. number of results to return for each request

Default 10

filterobject

Optional filter to refine search results by document type. This allows you to limit the search to specific document types, which can be useful when you have multiple document types in your index. You can specify either a single document type as a string or an array of document types.

typeoneOf

Filter results to include only documents of the specified type(s)

json
{
  "query": "string",
  "maxResults": 10,
  "filter": {
    "type": null
  }
}

Response

Returns 200 with a array<object>. Read it in later steps with {{postEmbeddingsIndexQueryDatasetIndexname.response.data.<field>}}.

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