mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-26 18:33:30 +08:00
Refine handling of POST /api/v1/datasets/search in GO (#15583)
### What problem does this PR solve? Refine handling of POST /api/v1/datasets/search in GO ### Type of change - [x] Refactoring
This commit is contained in:
@@ -1058,9 +1058,8 @@ async def search(dataset_id: str, tenant_id: str, req: dict):
|
||||
ranks["chunks"].insert(0, ck)
|
||||
except Exception:
|
||||
logging.warning("search KG retrieval failed: dataset=%s tenant=%s", dataset_id, tenant_id, exc_info=True)
|
||||
total = ranks.get("total", 0)
|
||||
ranks["chunks"] = settings.retriever.retrieval_by_children(ranks["chunks"], tenant_ids)
|
||||
ranks["total"] = total
|
||||
ranks["total"] = len(ranks["chunks"])
|
||||
|
||||
for c in ranks["chunks"]:
|
||||
c.pop("vector", None)
|
||||
@@ -1430,9 +1429,8 @@ async def search_datasets(tenant_id: str, req: dict):
|
||||
ranks["chunks"].insert(0, ck)
|
||||
except Exception:
|
||||
logging.warning("search_datasets KG retrieval failed: datasets=%s tenant=%s", kb_ids, tenant_id, exc_info=True)
|
||||
total = ranks.get("total", 0)
|
||||
ranks["chunks"] = settings.retriever.retrieval_by_children(ranks["chunks"], tenant_ids)
|
||||
ranks["total"] = total
|
||||
ranks["total"] = len(ranks["chunks"])
|
||||
|
||||
for c in ranks["chunks"]:
|
||||
c.pop("vector", None)
|
||||
|
||||
Reference in New Issue
Block a user