Skip to content

Commit

Permalink
Fix export filtering.
Browse files Browse the repository at this point in the history
  • Loading branch information
kishorenc committed Dec 10, 2021
1 parent ec940b3 commit 34f7595
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/core_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,7 @@ bool get_export_documents(const std::shared_ptr<http_req>& req, const std::share
}

if(simple_filter_query.empty()) {
export_state->it = collectionManager.get_store()->get_iterator();
export_state->it->Seek(seq_id_prefix);
export_state->it = collectionManager.get_store()->scan(seq_id_prefix);
} else {
auto filter_ids_op = collection->get_filter_ids(simple_filter_query, export_state->index_ids);

Expand Down
2 changes: 2 additions & 0 deletions src/core_api_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ Option<bool> stateful_remove_docs(deletion_state_t* deletion_state, size_t batch
Option<bool> stateful_export_docs(export_state_t* export_state, size_t batch_size, bool& done) {
size_t batch_count = 0;

export_state->res_body->clear();

for(size_t i = 0; i < export_state->index_ids.size(); i++) {
std::pair<size_t, uint32_t*>& size_ids = export_state->index_ids[i];
size_t ids_len = size_ids.first;
Expand Down

0 comments on commit 34f7595

Please sign in to comment.