Method to perform a similarity search in the vector store using a query vector. It returns the k most similar documents along with their similarity scores. An optional filter function can be provided to filter the documents.
similaritySearchVectorWithScore(
query: number[],
k: number,
filter: (doc: Document) => boolean
): Promise<[Document<Record<string, any>>, number][]>| Name | Type | Description |
|---|---|---|
query* | number[] | The query vector. |
k* | number | The number of most similar documents to return. |
filter | (doc: Document) => boolean | An optional filter function to filter the documents. |