Performs a similarity search on the vectors in the collection. The search is performed using the given query vector and returns the top k most similar vectors along with their corresponding documents and similarity scores.
similaritySearchVectorWithScore(
query: number[],
k: number,
filter: Record<string, any>
): Promise<[Document<Record<string, any>>, number][]>| Name | Type | Description |
|---|---|---|
query* | number[] | Query vector for the similarity search. |
k* | number | Number of top similar vectors to return. |
filter | Record<string, any> | Optional. Filter to apply on the metadata of the documents. |