mirror of
https://github.com/typesense/typesense.git
synced 2025-05-21 22:33:27 +08:00
Fix replacing overrides.
This commit is contained in:
parent
19e38681d5
commit
6fbc814070
@ -1603,7 +1603,7 @@ Option<uint32_t> Collection::add_override(const override_t & override) {
|
||||
return Option<uint32_t>(500, "Error while storing the override on disk.");
|
||||
}
|
||||
|
||||
overrides.emplace(override.id, override);
|
||||
overrides[override.id] = override;
|
||||
return Option<uint32_t>(200);
|
||||
}
|
||||
|
||||
|
@ -258,6 +258,11 @@ TEST_F(CollectionOverrideTest, ExcludeIncludeFacetFilterQuery) {
|
||||
ASSERT_EQ(1, results["hits"].size());
|
||||
ASSERT_EQ("0", results["hits"][0]["document"]["id"].get<std::string>());
|
||||
|
||||
// should be able to replace existing override
|
||||
override_include.rule.query = "found";
|
||||
coll_mul_fields->add_override(override_include);
|
||||
ASSERT_STREQ("found", coll_mul_fields->get_overrides()["include-rule"].rule.query.c_str());
|
||||
|
||||
coll_mul_fields->remove_override("include-rule");
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user