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

Improve wildcard + dict test.

Kishore Nallanf44f75a4981a
diff --git a/test/collection_all_fields_test.cpp b/test/collection_all_fields_test.cpp
index 6ef6103d..ba73c501 100644
--- a/test/collection_all_fields_test.cpp
+++ b/test/collection_all_fields_test.cpp
@@ -1097,6 +1097,7 @@ TEST_F(CollectionAllFieldsTest, WildcardFieldAndDictionaryField) {
}
nlohmann::json doc;
+ doc["year"] = 2000;
doc["kinds"] = nlohmann::json::object();
doc["kinds"]["CGXX"] = 13;
doc["kinds"]["ZBXX"] = 24;
@@ -1104,6 +1105,14 @@ TEST_F(CollectionAllFieldsTest, WildcardFieldAndDictionaryField) {
auto add_op = coll1->add(doc.dump(), CREATE);
ASSERT_TRUE(add_op.ok());
+ auto results = coll1->search("*", {}, "year: 2000", {}, sort_fields, {0}, 10, 1, FREQUENCY, {false}).get();
+ ASSERT_EQ(1, results["hits"].size());
+
+ auto schema = coll1->get_fields();
+ ASSERT_EQ(2, schema.size());
+ ASSERT_EQ(".*", schema[0].name);
+ ASSERT_EQ("year", schema[1].name);
+
collectionManager.drop_collection("coll1");
}