Skip to content

Open Source alternative to Algolia + Pinecone and an Easier-to-Use alternative to ElasticSearch ⚡ 🔍 ✨ Fast, typo tolerant, in-memory fuzzy Search Engine for building delightful search experiences

Properly release buffered export body.

Kishore Nallan43969c3abd19
diff --git a/src/core_api.cpp b/src/core_api.cpp
index 8a53e707..9ce10b81 100644
--- a/src/core_api.cpp
+++ b/src/core_api.cpp
@@ -715,7 +715,7 @@ bool get_export_documents(const std::shared_ptr<http_req>& req, const std::share
if(export_state->it != nullptr) {
rocksdb::Iterator* it = export_state->it;
size_t batch_counter = 0;
- res->body.clear();
+ std::string().swap(res->body);
while(it->Valid() && it->key().ToString().compare(0, seq_id_prefix.size(), seq_id_prefix) == 0) {
if(export_state->include_fields.empty() && export_state->exclude_fields.empty()) {