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
Dynamic filtering via overrides should not use typos.
Kishore Nallane12711ebf4fe
diff --git a/src/index.cpp b/src/index.cppindex 7fb73c31..00b9c5d0 100644--- a/src/index.cpp+++ b/src/index.cpp@@ -2126,9 +2126,9 @@ bool Index::check_for_overrides(const token_ordering& token_order, const string&}search_field(0, window_tokens, nullptr, 0, num_toks_dropped, field_it->second, field_name,- nullptr, 0, {}, {}, -1, 2, searched_queries, topster, groups_processed,+ nullptr, 0, {}, {}, -1, 0, searched_queries, topster, groups_processed,&result_ids, result_ids_len, field_num_results, 0, group_by_fields,- false, 4, query_hashes, token_order, false, 0, 1, false, -1, 3, 7, 4);+ false, 4, query_hashes, token_order, false, 0, 0, false, -1, 3, 7, 4);if(result_ids_len != 0) {// we need to narraw onto the exact matchesdiff --git a/test/collection_override_test.cpp b/test/collection_override_test.cppindex 9caecaaa..df3c131f 100644--- a/test/collection_override_test.cpp+++ b/test/collection_override_test.cpp@@ -2079,7 +2079,19 @@ TEST_F(CollectionOverrideTest, DynamicFilteringWithPartialTokenMatch) {doc1["name"] = "Amazing Shoes";doc1["category"] = "Running Shoes";+ nlohmann::json doc2;+ doc2["id"] = "1";+ doc2["name"] = "Magic Lamp";+ doc2["category"] = "Shoo";++ nlohmann::json doc3;+ doc3["id"] = "2";+ doc3["name"] = "Shox and Us";+ doc3["category"] = "Socks";+ASSERT_TRUE(coll1->add(doc1.dump()).ok());+ ASSERT_TRUE(coll1->add(doc2.dump()).ok());+ ASSERT_TRUE(coll1->add(doc3.dump()).ok());std::vector<sort_by> sort_fields = {sort_by("_text_match", "DESC")};@@ -2111,5 +2123,11 @@ TEST_F(CollectionOverrideTest, DynamicFilteringWithPartialTokenMatch) {{}, sort_fields, {0}, 10).get();ASSERT_EQ(1, results["hits"].size());++ results = coll1->search("shox", {"name"}, "",+ {}, sort_fields, {0}, 10).get();++ ASSERT_EQ(1, results["hits"].size());+collectionManager.drop_collection("coll1");}