mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-27 16:51:01 +00:00
Update the test to accept the new IS syntax
This commit is contained in:
@ -87,11 +87,11 @@ test_filter!(exists_filter_1_not, vec![Right("opt1 NOT EXISTS")]);
|
||||
test_filter!(exists_filter_1_not_alt, vec![Right("NOT opt1 EXISTS")]);
|
||||
test_filter!(exists_filter_1_double_not, vec![Right("NOT opt1 NOT EXISTS")]);
|
||||
|
||||
test_filter!(null_filter_1, vec![Right("opt1 NULL")]);
|
||||
test_filter!(null_filter_2, vec![Right("opt1.opt2 NULL")]);
|
||||
test_filter!(null_filter_1_not, vec![Right("opt1 NOT NULL")]);
|
||||
test_filter!(null_filter_1_not_alt, vec![Right("NOT opt1 NULL")]);
|
||||
test_filter!(null_filter_1_double_not, vec![Right("NOT opt1 NOT NULL")]);
|
||||
test_filter!(null_filter_1, vec![Right("opt1 IS NULL")]);
|
||||
test_filter!(null_filter_2, vec![Right("opt1.opt2 IS NULL")]);
|
||||
test_filter!(null_filter_1_not, vec![Right("opt1 IS NOT NULL")]);
|
||||
test_filter!(null_filter_1_not_alt, vec![Right("NOT opt1 IS NULL")]);
|
||||
test_filter!(null_filter_1_double_not, vec![Right("NOT opt1 IS NOT NULL")]);
|
||||
|
||||
test_filter!(in_filter, vec![Right("tag_in IN[1, 2, 3, four, five]")]);
|
||||
test_filter!(not_in_filter, vec![Right("tag_in NOT IN[1, 2, 3, four, five]")]);
|
||||
|
@ -205,11 +205,11 @@ fn execute_filter(filter: &str, document: &TestDocument) -> Option<String> {
|
||||
} else if let Some(opt1) = &document.opt1 {
|
||||
id = contains_key_rec(opt1, "opt2").then(|| document.id.clone());
|
||||
}
|
||||
} else if matches!(filter, "opt1 NULL" | "NOT opt1 NOT NULL") {
|
||||
} else if matches!(filter, "opt1 IS NULL" | "NOT opt1 IS NOT NULL") {
|
||||
id = document.opt1.as_ref().map_or(false, |v| v.is_null()).then(|| document.id.clone());
|
||||
} else if matches!(filter, "NOT opt1 NULL" | "opt1 NOT NULL") {
|
||||
} else if matches!(filter, "NOT opt1 IS NULL" | "opt1 IS NOT NULL") {
|
||||
id = document.opt1.as_ref().map_or(true, |v| !v.is_null()).then(|| document.id.clone());
|
||||
} else if matches!(filter, "opt1.opt2 NULL") {
|
||||
} else if matches!(filter, "opt1.opt2 IS NULL") {
|
||||
if document.opt1opt2.as_ref().map_or(false, |v| v.is_null()) {
|
||||
id = Some(document.id.clone());
|
||||
} else if let Some(opt1) = &document.opt1 {
|
||||
|
Reference in New Issue
Block a user