Skip to content

Commit a32586f

Browse files
community[patch]: overriding similaritySearchWithScore in neo4j vector store to enable filtering (#5599)
* overriding similaritySearchWithScore * Format * Fix build --------- Co-authored-by: jacoblee93 <jacoblee93@gmail.com>
1 parent 6371927 commit a32586f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎libs/langchain-community/src/vectorstores/neo4j_vector.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,15 @@ export class Neo4jVectorStore extends VectorStore {
637637
return results.map((result) => result[0]);
638638
}
639639

640+
async similaritySearchWithScore(
641+
query: string,
642+
k = 4,
643+
params: Record<string, any> = {}
644+
): Promise<[Document, number][]> {
645+
const embedding = await this.embeddings.embedQuery(query);
646+
return this.similaritySearchVectorWithScore(embedding, k, query, params);
647+
}
648+
640649
async similaritySearchVectorWithScore(
641650
vector: number[],
642651
k: number,

0 commit comments

Comments
 (0)