瀏覽代碼

fix: pgvector metadata filter (#16688)

Signed-off-by: kenwoodjw <blackxin55+@gmail.com>
tags/1.2.0
kenwoodjw 7 月之前
父節點
當前提交
a113356695
No account linked to committer's email address
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2
    2
      api/core/rag/datasource/vdb/pgvector/pgvector.py

+ 2
- 2
api/core/rag/datasource/vdb/pgvector/pgvector.py 查看文件

@@ -177,7 +177,7 @@ class PGVector(BaseVector):
where_clause = ""
if document_ids_filter:
document_ids = ", ".join(f"'{id}'" for id in document_ids_filter)
where_clause = f" WHERE metadata->>'document_id' in ({document_ids}) "
where_clause = f" WHERE meta->>'document_id' in ({document_ids}) "

with self._get_cursor() as cur:
cur.execute(
@@ -205,7 +205,7 @@ class PGVector(BaseVector):
where_clause = ""
if document_ids_filter:
document_ids = ", ".join(f"'{id}'" for id in document_ids_filter)
where_clause = f" AND metadata->>'document_id' in ({document_ids}) "
where_clause = f" AND meta->>'document_id' in ({document_ids}) "
if self.pg_bigm:
cur.execute("SET pg_bigm.similarity_limit TO 0.000001")
cur.execute(

Loading…
取消
儲存