Skip to main content

Interface: VectorSearchQuery<TableInfo, IndexName>

server.VectorSearchQuery

An object with parameters for performing a vector search against a vector index.

Type parameters

NameType
TableInfoextends GenericTableInfo
IndexNameextends VectorIndexNames<TableInfo>

Properties

vector

vector: number[]

The query vector.

This must have the same length as the dimensions of the index. This vector search will return the IDs of the documents most similar to this vector.

Defined in

server/vector_search.ts:30


limit

Optional limit: number

The number of results to return. If specified, must be between 1 and 256 inclusive.

Default

10

Defined in

server/vector_search.ts:37


filter

Optional filter: (q: VectorFilterBuilder<DocumentByInfo<TableInfo>, NamedVectorIndex<TableInfo, IndexName>>) => FilterExpression<boolean>

Type declaration

▸ (q): FilterExpression<boolean>

Optional filter expression made up of q.or and q.eq operating over the filter fields of the index.

e.g. filter: q => q.or(q.eq("genre", "comedy"), q.eq("genre", "drama"))

Parameters
NameType
qVectorFilterBuilder<DocumentByInfo<TableInfo>, NamedVectorIndex<TableInfo, IndexName>>
Returns

FilterExpression<boolean>

Defined in

server/vector_search.ts:47