Return total documents in collection in every search response.

This commit is contained in:
kishorenc 2020-12-25 21:06:38 +05:30
parent 1a8d5a0912
commit e07dcded7b

View File

@ -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();