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 synonym symbols view rendering issue.
Kishore Nallan644677d52256
diff --git a/src/synonym_index.cpp b/src/synonym_index.cppindex eeb40e43..7a0293f3 100644--- a/src/synonym_index.cpp+++ b/src/synonym_index.cpp@@ -262,7 +262,10 @@ nlohmann::json synonym_t::to_view_json() const {}if(!symbols.empty()) {- obj["symbols"] = symbols;+ obj["symbols"] = nlohmann::json::array();+ for(char c: symbols) {+ obj["symbols"].push_back(std::string(1, c));+ }}return obj;diff --git a/test/collection_synonyms_test.cpp b/test/collection_synonyms_test.cppindex cf49f4f9..0a5ee304 100644--- a/test/collection_synonyms_test.cpp+++ b/test/collection_synonyms_test.cpp@@ -96,6 +96,11 @@ TEST_F(CollectionSynonymsTest, SynonymParsingFromJson) {ASSERT_STREQ("plus", synonym_plus.synonyms[0][0].c_str());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>());+// when `id` is not givennlohmann::json syn_json_without_id = {{"root", "Ocean"},