feat(es): paginate past 10k documents via pit and search_after
This commit is contained in:
1 parent
1d71a5fc23
commit
73a7b3f2c7
35 files changed
+1622
-153
No files matched your search
@@ -424,6 +424,7 @@ pub async fn find_documents_core(
|
||||
sort: Option<&str>,
|
||||
collation: Option<&str>,
|
||||
cursor: Option<&str>,
|
||||
cursor_pagination: bool,
|
||||
) -> Result<DocumentQueryResult, String> {
|
||||
ensure_document_pool(state, connection_id).await?;
|
||||
let connections = state.connections.read().await;
|
||||
@@ -445,12 +446,20 @@ pub async fn find_documents_core(
|
||||
PoolKind::Elasticsearch(client) => {
|
||||
let client = client.clone();
|
||||
drop(connections);
|
||||
elasticsearch_driver::find_documents(&client, collection, skip, limit, filter, sort).await
|
||||
if cursor_pagination {
|
||||
elasticsearch_driver::find_documents_with_cursor(&client, collection, limit, filter, sort, cursor).await
|
||||
} else {
|
||||
elasticsearch_driver::find_documents(&client, collection, skip, limit, filter, sort).await
|
||||
}
|
||||
}
|
||||
PoolKind::Easysearch(client) => {
|
||||
let client = client.clone();
|
||||
drop(connections);
|
||||
easysearch_driver::find_documents(&client, collection, skip, limit, filter, sort).await
|
||||
if cursor_pagination {
|
||||
easysearch_driver::find_documents_with_cursor(&client, collection, limit, filter, sort, cursor).await
|
||||
} else {
|
||||
easysearch_driver::find_documents(&client, collection, skip, limit, filter, sort).await
|
||||
}
|
||||
}
|
||||
PoolKind::Meilisearch(client) => {
|
||||
let client = client.clone();
|
||||
|
||||
Reference in new issue
Block a user