feat(es): paginate past 10k documents via pit and search_after

This commit is contained in:
Lan-zk authored and GitHub committed 2026-08-30 03:57:03 +08:00
1 parent 1d71a5fc23
commit 73a7b3f2c7
35 files changed
+1622 -153

No files matched your search

+10
View File
@@ -4526,6 +4526,7 @@ export const useQueryStore = defineStore("query", () => {
preserveTotalRowCountDuringExecution?: boolean;
preserveActiveResultIndex?: boolean;
replaceActiveResultInGroup?: boolean;
retainDisplayedResult?: boolean;
skipRedisSafetyCheck?: boolean;
sourceOffset?: number;
sourceTraceId?: string;
@@ -5454,6 +5455,15 @@ export const useQueryStore = defineStore("query", () => {
const activeGroupResults = current.results;
const shouldAppendResult = !!options?.appendResult && !!current.result;
const shouldReplaceActiveResultInGroup = options?.replaceActiveResultInGroup === true && results.length === 1 && Array.isArray(activeGroupResults) && typeof activeGroupIndex === "number" && activeGroupIndex >= 0 && activeGroupIndex < activeGroupResults.length;
const retainedPaginationResult = options?.retainDisplayedResult === true && results.length === 1 && !isQueryExecutionErrorResult(results[0]!) ? results[0] : undefined;
if (retainedPaginationResult) {
// Cursor-only fetches advance the backend session without publishing
// intermediate rows or page offsets to the visible result grid.
current.resultSessionId = retainedPaginationResult.session_id ?? undefined;
current.resultClientSessionId = current.resultSessionId ? executionClientSessionId : undefined;
producedResult = true;
return producedResult;
}
if (batchResume) {
const mergedResults = mergeBatchQueryResults(batchResume.previousResults, results);
const preferredResult = results.find((result) => isQueryExecutionErrorResult(result)) ?? results[results.length - 1] ?? mergedResults[mergedResults.length - 1];