Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix: add toc_kwd field and update page_num_int type (#10596)

Liu An8af769de410a
diff --git a/conf/infinity_mapping.json b/conf/infinity_mapping.json
index 3e39044a72..e44766447c 100644
--- a/conf/infinity_mapping.json
+++ b/conf/infinity_mapping.json
@@ -31,7 +31,6 @@
"entities_kwd": {"type": "varchar", "default": "", "analyzer": "whitespace-#"},
"pagerank_fea": {"type": "integer", "default": 0},
"tag_feas": {"type": "varchar", "default": "", "analyzer": "rankfeatures"},
-
"from_entity_kwd": {"type": "varchar", "default": "", "analyzer": "whitespace-#"},
"to_entity_kwd": {"type": "varchar", "default": "", "analyzer": "whitespace-#"},
"entity_kwd": {"type": "varchar", "default": "", "analyzer": "whitespace-#"},
@@ -39,6 +38,6 @@
"source_id": {"type": "varchar", "default": "", "analyzer": "whitespace-#"},
"n_hop_with_weight": {"type": "varchar", "default": ""},
"removed_kwd": {"type": "varchar", "default": "", "analyzer": "whitespace-#"},
-
- "doc_type_kwd": {"type": "varchar", "default": "", "analyzer": "whitespace-#"}
+ "doc_type_kwd": {"type": "varchar", "default": "", "analyzer": "whitespace-#"},
+ "toc_kwd": {"type": "varchar", "default": "", "analyzer": "whitespace-#"}
}
diff --git a/rag/svr/task_executor.py b/rag/svr/task_executor.py
index 14a0b5cda7..7674952ff5 100644
--- a/rag/svr/task_executor.py
+++ b/rag/svr/task_executor.py
@@ -447,7 +447,7 @@ def build_TOC(task, docs, progress_callback):
d["content_with_weight"] = json.dumps(toc, ensure_ascii=False)
d["toc_kwd"] = "toc"
d["available_int"] = 0
- d["page_num_int"] = 100000000
+ d["page_num_int"] = [100000000]
d["id"] = xxhash.xxh64((d["content_with_weight"] + str(d["doc_id"])).encode("utf-8", "surrogatepass")).hexdigest()
return d