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
@@ -61,6 +61,23 @@ pub async fn find_documents(
|
||||
.map_err(easysearch_error)
|
||||
}
|
||||
|
||||
pub async fn find_documents_with_cursor(
|
||||
client: &EasysearchClient,
|
||||
index: &str,
|
||||
limit: i64,
|
||||
filter: Option<&str>,
|
||||
sort: Option<&str>,
|
||||
cursor: Option<&str>,
|
||||
) -> Result<DocumentQueryResult, String> {
|
||||
elasticsearch_driver::find_documents_with_cursor(&client.inner, index, limit, filter, sort, cursor)
|
||||
.await
|
||||
.map_err(easysearch_error)
|
||||
}
|
||||
|
||||
pub async fn close_cursor(client: &EasysearchClient, cursor: &str) -> Result<(), String> {
|
||||
elasticsearch_driver::close_cursor(&client.inner, cursor).await.map_err(easysearch_error)
|
||||
}
|
||||
|
||||
pub async fn count_documents(client: &EasysearchClient, index: &str, filter: Option<&str>) -> Result<u64, String> {
|
||||
elasticsearch_driver::count_documents(&client.inner, index, filter).await.map_err(easysearch_error)
|
||||
}
|
||||
@@ -97,7 +114,17 @@ pub async fn delete_document(
|
||||
}
|
||||
|
||||
pub async fn execute_rest_query(client: &EasysearchClient, input: &str) -> Result<QueryResult, String> {
|
||||
elasticsearch_driver::execute_rest_query_with_sql_parser(&client.inner, input, parse_sql_response)
|
||||
elasticsearch_driver::execute_rest_query_with_sql_parser(&client.inner, input, parse_sql_response, None)
|
||||
.await
|
||||
.map_err(easysearch_error)
|
||||
}
|
||||
|
||||
pub async fn execute_rest_query_with_cursor(
|
||||
client: &EasysearchClient,
|
||||
input: &str,
|
||||
cursor: Option<&str>,
|
||||
) -> Result<QueryResult, String> {
|
||||
elasticsearch_driver::execute_rest_query_with_sql_parser(&client.inner, input, parse_sql_response, cursor)
|
||||
.await
|
||||
.map_err(easysearch_error)
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user