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
Fix symbols_to_index key in response.
Kishore Nallanf4b8b4c62795
diff --git a/src/synonym_index.cpp b/src/synonym_index.cppindex 7a0293f3..73bb86be 100644--- a/src/synonym_index.cpp+++ b/src/synonym_index.cpp@@ -262,9 +262,9 @@ nlohmann::json synonym_t::to_view_json() const {}if(!symbols.empty()) {- obj["symbols"] = nlohmann::json::array();+ obj["symbols_to_index"] = nlohmann::json::array();for(char c: symbols) {- obj["symbols"].push_back(std::string(1, c));+ obj["symbols_to_index"].push_back(std::string(1, c));}}diff --git a/test/collection_synonyms_test.cpp b/test/collection_synonyms_test.cppindex 0a5ee304..8568e834 100644--- a/test/collection_synonyms_test.cpp+++ b/test/collection_synonyms_test.cpp@@ -97,9 +97,9 @@ TEST_F(CollectionSynonymsTest, SynonymParsingFromJson) {ASSERT_STREQ("#", synonym_plus.synonyms[1][0].c_str());nlohmann::json view_json = synonym_plus.to_view_json();- ASSERT_EQ(2, view_json["symbols"].size());- ASSERT_EQ("+", view_json["symbols"][0].get<std::string>());- ASSERT_EQ("#", view_json["symbols"][1].get<std::string>());+ ASSERT_EQ(2, view_json["symbols_to_index"].size());+ ASSERT_EQ("+", view_json["symbols_to_index"][0].get<std::string>());+ ASSERT_EQ("#", view_json["symbols_to_index"][1].get<std::string>());// when `id` is not givennlohmann::json syn_json_without_id = {