Skip to main content
Searches for nearest neighbors in the encrypted index using vector similarity search. Supports both single vector queries and batch queries with multiple vectors.

Method Overloads

The query method supports two calling patterns:

Pattern 1: Individual Parameters

Pattern 2: Request Object

Parameters

Individual Parameters Pattern

Request Object Pattern

Returns

Promise<QueryResponse>: A Promise that resolves to search results. The response format depends on whether a single vector or multiple vectors were queried:
  • Single vector query: results is a flat array of QueryResultItem[]
  • Batch query: results is a nested array of QueryResultItem[][] (one array per input vector)

Exceptions

  • Throws if the API request fails due to network connectivity issues.
  • Throws if authentication fails (invalid API key).
  • Throws if the encryption key is invalid for the specified index.
  • Throws if there are internal server errors during the search.
  • Throws if no query vector is provided.
  • Throws if vector dimensions don’t match the index configuration.
  • Throws if parameter values are out of valid ranges.
  • Throws if the include parameter contains invalid field names.

Example Usage

Basic Single Vector Query

Advanced Single Query with Options

Batch Vector Query

Metadata Filtering

QueryResultItem Fields