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

Add test for cyrillic facet query highlight.

Kishore Nalland6583e7e1eb1
diff --git a/test/collection_locale_test.cpp b/test/collection_locale_test.cpp
index 7bf06a8c..45d3cff6 100644
--- a/test/collection_locale_test.cpp
+++ b/test/collection_locale_test.cpp
@@ -600,5 +600,21 @@ TEST_F(CollectionLocaleTest, SearchOnCyrillicTextWithSpecialCharacters) {
ASSERT_EQ("скромности. Посыл, среди которых <mark>отсутствие</mark> мобильного страшное",
results["hits"][0]["highlights"][0]["snippet"].get<std::string>());
+ results = coll1->search("*", {}, "", {"title"}, {}, {0}, 0, 1, FREQUENCY, {true}, 10,
+ spp::sparse_hash_set<std::string>(), spp::sparse_hash_set<std::string>(),
+ 10, "title: отсутствие").get();
+
+ ASSERT_STREQ("«Сирый», «несчастный», «никчёмный» — принятое особ, сейчас, впрочем, оттенок скромности. "
+ "Посыл, среди которых <mark>отсутствие</mark> мобильного страшное.",
+ results["facet_counts"][0]["counts"][0]["highlighted"].get<std::string>().c_str());
+
+ results = coll1->search("*", {}, "", {"title"}, {}, {0}, 0, 1, FREQUENCY, {true}, 10,
+ spp::sparse_hash_set<std::string>(), spp::sparse_hash_set<std::string>(),
+ 10, "title: отсутст").get();
+
+ ASSERT_STREQ("«Сирый», «несчастный», «никчёмный» — принятое особ, сейчас, впрочем, оттенок скромности. "
+ "Посыл, среди которых <mark>отсутст</mark>вие мобильного страшное.",
+ results["facet_counts"][0]["counts"][0]["highlighted"].get<std::string>().c_str());
+
collectionManager.drop_collection("coll1");
}