From 620fe215a4d59e959073c5e895ebf3757b9b829b Mon Sep 17 00:00:00 2001 From: qinling0210 <88864212+qinling0210@users.noreply.github.com> Date: Mon, 30 Mar 2026 19:37:19 +0800 Subject: [PATCH] Fix python metadata search (#13727) ### What problem does this PR solve? Fix python metadata search ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- rag/utils/infinity_conn.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rag/utils/infinity_conn.py b/rag/utils/infinity_conn.py index c039a7f7c..4eeba7083 100644 --- a/rag/utils/infinity_conn.py +++ b/rag/utils/infinity_conn.py @@ -148,8 +148,11 @@ class InfinityConnection(InfinityConnectionBase): filter_cond = None filter_fulltext = "" if condition: - # Remove kb_id filter for Infinity (it uses table separation instead) - condition = {k: v for k, v in condition.items() if k != "kb_id"} + # For metadata table (ragflow_doc_meta_), keep kb_id filter + # For chunk tables, remove kb_id filter as they use table separation per KB + is_meta_table = any(indexName.startswith("ragflow_doc_meta_") for indexName in index_names) + if not is_meta_table: + condition = {k: v for k, v in condition.items() if k != "kb_id"} table_found = False for indexName in index_names: