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

Make remove_matched_tokens: true by default.

Kishore Nallanb82b4a5bcee8
diff --git a/include/index.h b/include/index.h
index ba53aac7..7743ea28 100644
--- a/include/index.h
+++ b/include/index.h
@@ -72,7 +72,7 @@ struct override_t {
std::vector<drop_hit_t> drop_hits;
std::string filter_by;
- bool remove_matched_tokens = false;
+ bool remove_matched_tokens = true;
override_t() = default;
diff --git a/test/collection_override_test.cpp b/test/collection_override_test.cpp
index 71032ed5..4d65bf16 100644
--- a/test/collection_override_test.cpp
+++ b/test/collection_override_test.cpp
@@ -1394,7 +1394,6 @@ TEST_F(CollectionOverrideTest, DynamicFilteringWithSynonyms) {
{"match", override_t::MATCH_EXACT}
}
},
- {"remove_matched_tokens", true},
{"filter_by", "category: {category}"}
};
@@ -1407,7 +1406,7 @@ TEST_F(CollectionOverrideTest, DynamicFilteringWithSynonyms) {
ASSERT_EQ(1, overrides.size());
auto override_json = overrides["dynamic-filters"].to_json();
ASSERT_EQ("category: {category}", override_json["filter_by"].get<std::string>());
- ASSERT_EQ(true, override_json["remove_matched_tokens"].get<bool>());
+ ASSERT_EQ(true, override_json["remove_matched_tokens"].get<bool>()); // must be true by default
nlohmann::json override_json2 = {
{"id", "static-filters"},