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

Return total documents in collection in every search response.

kishorence07dcded7bd5
diff --git a/src/collection.cpp b/src/collection.cpp
index 8191ff10..2eda9305 100644
--- a/src/collection.cpp
+++ b/src/collection.cpp
@@ -921,6 +921,7 @@ Option<nlohmann::json> Collection::search(const std::string & query, const std::
nlohmann::json result = nlohmann::json::object();
result["found"] = total_found;
+ result["out_of"] = num_documents;
std::string hits_key = group_limit ? "grouped_hits" : "hits";
result[hits_key] = nlohmann::json::array();