Skip to content

feat: Add support for Exists leaf in query parser#2798

Open
Darkheir wants to merge 2 commits into
quickwit-oss:mainfrom
Darkheir:feat/query_parser_exists
Open

feat: Add support for Exists leaf in query parser#2798
Darkheir wants to merge 2 commits into
quickwit-oss:mainfrom
Darkheir:feat/query_parser_exists

Conversation

@Darkheir
Copy link
Copy Markdown
Contributor

@Darkheir Darkheir commented Jan 9, 2026

A while ago the Exists syntax was added to the query grammar: #2170.
It was never added to the query parser and this PR aims to implement this part.

Signed-off-by: Darkheir <raphael.cohen@sekoia.io>
Comment thread src/query/query_parser/logical_ast.rs Outdated
@@ -159,6 +162,7 @@ impl fmt::Debug for LogicalLiteral {
ref pattern,
ref field,
} => write!(formatter, "Regex({field:?}, {pattern:?})"),
LogicalLiteral::Exists { ref field } => write!(formatter, "exists:{field}"),
Copy link
Copy Markdown
Contributor

@xingtanzjr xingtanzjr Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That may be ambuigous if we put operator exists before :. For example, if user gives this query

'exists:title'

it may be treated as something like finding title term in feild exists.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough, I updated the PR to follow the same syntax as for regexes.

@xingtanzjr
Copy link
Copy Markdown
Contributor

_ No description provided. _

Maybe we can add some description here

Signed-off-by: Darkheir <raphael.cohen@sekoia.io>
@Darkheir
Copy link
Copy Markdown
Contributor Author

Maybe we can add some description here

Added a small description, but there is not much to say :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants