mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 11:57:07 +02:00
Improve syntax of EXISTS filter, allow “value NOT EXISTS”
This commit is contained in:
parent
72452f0cb2
commit
dc64170a69
4 changed files with 46 additions and 31 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue