mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-27 16:51:01 +00:00
Improve syntax of EXISTS filter, allow “value NOT EXISTS”
This commit is contained in:
@ -280,11 +280,11 @@ impl<'a> Filter<'a> {
|
||||
Condition::LowerThan(val) => (Included(f64::MIN), Excluded(val.parse()?)),
|
||||
Condition::LowerThanOrEqual(val) => (Included(f64::MIN), Included(val.parse()?)),
|
||||
Condition::Between { from, to } => (Included(from.parse()?), Included(to.parse()?)),
|
||||
Condition::Exist => {
|
||||
Condition::Exists => {
|
||||
let exist = index.exists_faceted_documents_ids(rtxn, field_id)?;
|
||||
return Ok(exist);
|
||||
}
|
||||
Condition::NotExist => {
|
||||
Condition::NotExists => {
|
||||
let all_ids = index.documents_ids(rtxn)?;
|
||||
|
||||
let exist = Self::evaluate_operator(
|
||||
@ -293,7 +293,7 @@ impl<'a> Filter<'a> {
|
||||
numbers_db,
|
||||
strings_db,
|
||||
field_id,
|
||||
&Condition::Exist,
|
||||
&Condition::Exists,
|
||||
)?;
|
||||
|
||||
let notexist = all_ids - exist;
|
||||
|
Reference in New Issue
Block a user