Skip to content

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

fix(search.py):remove hard page_size (#8242)

Wesley3d0b440e9fcd
diff --git a/rag/nlp/search.py b/rag/nlp/search.py
index c79bc2d27c..855468c9e0 100644
--- a/rag/nlp/search.py
+++ b/rag/nlp/search.py
@@ -380,15 +380,12 @@ class Dealer:
rank_feature=rank_feature)
# Already paginated in search function
idx = np.argsort(sim * -1)[(page - 1) * page_size:page * page_size]
-
-
dim = len(sres.query_vector)
vector_column = f"q_{dim}_vec"
zero_vector = [0.0] * dim
- if doc_ids:
- similarity_threshold = 0
- page_size = 30
sim_np = np.array(sim)
+ if doc_ids:
+ similarity_threshold = 0
filtered_count = (sim_np >= similarity_threshold).sum()
ranks["total"] = int(filtered_count) # Convert from np.int64 to Python int otherwise JSON serializable error
for i in idx: