Bugfix/implement missing delete method on pgvector (#3180)

implement missing delete method on pgvector
This commit is contained in:
Henry Heng
2024-09-12 02:28:45 +01:00
committed by GitHub
parent 56f9208d7c
commit 07059182af
2 changed files with 33 additions and 5 deletions
@@ -191,6 +191,18 @@ class Postgres_VectorStores implements INode {
return await similaritySearchVectorWithScore(query, k, tableName, postgresConnectionOptions, filter)
}
vectorStore.delete = async (params: { ids: string[] }): Promise<void> => {
const { ids } = params
if (ids?.length) {
try {
vectorStore.appDataSource.getRepository(vectorStore.documentEntity).delete(ids)
} catch (e) {
console.error('Failed to delete')
}
}
}
await recordManager.createSchema()
const res = await index({