search() with mode: 'vector'.
Signature
Parameters
The Orama database instance to search.
Vector search parameters:
Vector configuration:
value: Array of numbers or Float32Array representing the query vectorproperty: Name of the vector property in your schema
Minimum similarity threshold (0-1). Documents with lower similarity scores are filtered out.
Maximum number of results to return.
Number of results to skip (for pagination).
Filter conditions to apply before vector search.
Facet configuration for result aggregation.
Group results by specific properties.
Whether to include vector values in results. By default, vectors are set to
null to reduce payload size.Language for tokenization (used if
where filters contain text fields).Returns
Total number of matching documents.
Array of search results, each containing:
id: Document ID (string)score: Similarity score (higher is more similar)document: The matched document
Search execution time:
raw: Time in nanosecondsformatted: Human-readable formatted time string
Facet aggregations (if
facets parameter was provided).Grouped results (if
groupBy parameter was provided).Examples
Basic Vector Search
Vector Search with Filters
Vector Search with Similarity Threshold
Include Vectors in Results
Pagination
Notes
- Vector dimensions must match the size defined in your schema (e.g.,
vector[384]requires 384-dimensional vectors) - The
similarityparameter uses cosine similarity by default - Vectors are automatically normalized internally
- For better performance with large datasets, consider using filters to narrow down the search space before vector comparison
- Pinning rules are automatically applied to vector search results