mirror of
https://github.com/typesense/typesense.git
synced 2025-05-19 13:12:22 +08:00
Minor changes in API response field names.
This commit is contained in:
parent
bb3ca4211a
commit
8644fa5d79
@ -16,7 +16,8 @@ void get_collections(http_req & req, http_res & res) {
|
||||
for(Collection* collection: collections) {
|
||||
nlohmann::json collection_map;
|
||||
collection_map["name"] = collection->get_name();
|
||||
json_response["data"].push_back(collection_map);
|
||||
collection_map["num_documents"] = collection->get_num_documents();
|
||||
json_response["collections"].push_back(collection_map);
|
||||
}
|
||||
|
||||
res.send_200(json_response.dump());
|
||||
|
@ -861,8 +861,8 @@ Option<nlohmann::json> Collection::search(std::string query, const std::vector<s
|
||||
snippet_stream << tokens[snippet_index];
|
||||
}
|
||||
|
||||
document["_snippets"] = nlohmann::json::object();
|
||||
document["_snippets"][field_name] = snippet_stream.str();
|
||||
document["_highlight"] = nlohmann::json::object();
|
||||
document["_highlight"][field_name] = snippet_stream.str();
|
||||
}
|
||||
|
||||
result["hits"].push_back(document);
|
||||
|
Loading…
x
Reference in New Issue
Block a user