mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-21 15:11:08 +08:00
Fix: The dataset retrieval test returned an incorrect total number. (#15901)
### What problem does this PR solve? Fix: The dataset retrieval test returned an incorrect total number. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --------- Co-authored-by: balibabu <assassin_cike@163.com>
This commit is contained in:
@@ -1429,7 +1429,6 @@ async def search_datasets(tenant_id: str, req: dict):
|
||||
except Exception:
|
||||
logging.warning("search_datasets KG retrieval failed: datasets=%s tenant=%s", kb_ids, tenant_id, exc_info=True)
|
||||
ranks["chunks"] = settings.retriever.retrieval_by_children(ranks["chunks"], tenant_ids)
|
||||
ranks["total"] = len(ranks["chunks"])
|
||||
|
||||
for c in ranks["chunks"]:
|
||||
c.pop("vector", None)
|
||||
|
||||
@@ -87,21 +87,24 @@ export const useTestRetrieval = () => {
|
||||
});
|
||||
|
||||
const refetch = useCallback(() => {
|
||||
setPage(1);
|
||||
if (queryParams.question) {
|
||||
mutation.mutate(queryParams);
|
||||
const newParams = { ...queryParams, page: 1 };
|
||||
mutation.mutate(newParams);
|
||||
}
|
||||
}, [mutation, queryParams]);
|
||||
|
||||
const onPaginationChange = useCallback(
|
||||
(newPage: number, newPageSize: number) => {
|
||||
setPage(newPage);
|
||||
const nextPage = newPageSize !== pageSize ? 1 : newPage;
|
||||
setPage(nextPage);
|
||||
setPageSize(newPageSize);
|
||||
if (mutation.data && queryParams.question) {
|
||||
const newParams = { ...queryParams, page: newPage, size: newPageSize };
|
||||
const newParams = { ...queryParams, page: nextPage, size: newPageSize };
|
||||
mutation.mutate(newParams);
|
||||
}
|
||||
},
|
||||
[mutation, queryParams],
|
||||
[mutation, queryParams, pageSize],
|
||||
);
|
||||
|
||||
const handleFilterSubmit = useCallback(
|
||||
|
||||
@@ -24,7 +24,7 @@ export default function RetrievalTesting() {
|
||||
filterValue,
|
||||
} = useTestRetrieval();
|
||||
|
||||
const [count] = useState(1);
|
||||
const [count] = useState(1); // TODO: Different layouts are needed; if they are no longer required, consider deleting them.
|
||||
|
||||
return (
|
||||
<div className="pr-5 pb-5">
|
||||
|
||||
Reference in New Issue
Block a user