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
C++ algoliadatastoreelasticsearchenterprise-searchfacetingfull-text-searchfuzzy-searchgeosearchin-memoryinstantsearchmerchandisingpineconesearchsearch-enginesemantic-searchsimilarity-searchsite-searchsynonymstypo-tolerancevector-search
Range delete for collection drops to reduce write amplification.
Kishore Nallan510283e441ff
diff --git a/include/store.h b/include/store.hindex ccbb2bae..68b7f635 100644--- a/include/store.h+++ b/include/store.h@@ -359,6 +359,11 @@ public:return db->DeleteRange(rocksdb::WriteOptions(), db->DefaultColumnFamily(), begin_key, end_key);}+ rocksdb::Status compact_range(const rocksdb::Slice& begin_key, const rocksdb::Slice& end_key) {+ std::shared_lock lock(mutex);+ return db->CompactRange(rocksdb::CompactRangeOptions(), &begin_key, &end_key);+ }+// Only for internal testsrocksdb::DB* _get_db_unsafe() const {return db;diff --git a/src/collection_manager.cpp b/src/collection_manager.cppindex aadcbf31..28bd0f5a 100644--- a/src/collection_manager.cpp+++ b/src/collection_manager.cpp@@ -465,6 +465,7 @@ Option<nlohmann::json> CollectionManager::drop_collection(const std::string& colconst std::string& del_end_prefix = std::to_string(collection->get_collection_id()) + "`";store->delete_range(del_key_prefix, del_end_prefix);store->flush();+ store->compact_range(del_key_prefix, del_end_prefix);// delete overridesconst std::string& del_override_prefix =