Improve syntax of EXISTS filter, allow “value NOT EXISTS”

This commit is contained in:
Loïc Lecrenier 2022-06-14 16:42:09 +02:00
parent 72452f0cb2
commit dc64170a69
4 changed files with 46 additions and 31 deletions

View file

@ -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;