Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse error on john AND -doe #4541

Closed
ddelemeny opened this issue Feb 7, 2024 · 5 comments · Fixed by #4700
Closed

Parse error on john AND -doe #4541

ddelemeny opened this issue Feb 7, 2024 · 5 comments · Fixed by #4700
Assignees
Labels
bug Something isn't working

Comments

@ddelemeny
Copy link
Collaborator

Describe the bug

From quickwit-oss/quickwit-datasource#56

Quickwit fails to parse john AND -doe :

image

However, the equivalent following queries parse correctly
john AND (-doe)
john -doe
john AND NOT doe

Configuration:
Quickwit 0.7.1 (0.7.1 2024-02-07T11:47:08Z)

@ddelemeny ddelemeny added the bug Something isn't working label Feb 7, 2024
@trinity-1686a
Copy link
Contributor

tantivy's strict query parser doesn't allow mixing boolean expr keywords (AND/OR) with occurs symbols (+/-)
the lenient parser (not integrated in Quickwit yet) allows this kind of things

@ddelemeny
Copy link
Collaborator Author

Okay,thanks @trinity-1686a, that explains it.

Should we outline the limitation in the docs ?

@fulmicoton
Copy link
Contributor

@trinity-1686a could we allow this in the non-lenient parser? It seems unambiguous.

@trinity-1686a
Copy link
Contributor

trinity-1686a commented Feb 7, 2024

@ddelemeny if it stays that way, probably

@fulmicoton previously we didn't have any logic to manage that kind of situation, now that we have (for the purpose of the lenient parser), having it for the strict parser sounds like a good idea.
An open question then is how should john OR +doe be interpreted. The lenient parse thinks it's *john +doe iirc, but maybe *john *doe would be less surprising (* denoting the "Should" occur)

@fmassot
Copy link
Contributor

fmassot commented Feb 27, 2024

+1 to handle that in the strict parser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants