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 doe AND error #4641

Closed
fmassot opened this issue Feb 27, 2024 · 2 comments · Fixed by #4700
Closed

Parse error on john doe AND error #4641

fmassot opened this issue Feb 27, 2024 · 2 comments · Fixed by #4700
Assignees
Labels
enhancement New feature or request

Comments

@fmassot
Copy link
Contributor

fmassot commented Feb 27, 2024

By default, Quickwit uses the AND operator. I would expect john doe AND error to be valid.

Am I missing something?

@fmassot fmassot added the enhancement New feature or request label Feb 27, 2024
@trinity-1686a
Copy link
Contributor

tantivy strict parser supports two mostly disjoint syntax:

  • a boolean operator syntax: john AND doe
  • an occur syntax: +john -doe

in the boolean syntax, there must be a boolean operator between each leaf term, and no occurrence marker.
in the occur syntax, there may be an occurrence marker (+/-) before each leaf term, and no boolean operator.

the provided query isn't valid in boolean syntax because it misses an operator between john and doe, and it isn't valid in occur syntax because there is a boolean operator between doe and error.

set_conjunction_by_default() changes what the default occur is in the occur syntax (from Should to Must). It doesn't really affect boolean syntax as all operators must be provided.

Tantivy tests includes a few example of things rejected in strict parsing, but allowed in lenient parsing, and what's the result (in occur syntax). We could try to make more syntax work with the strict parser, by leveraging that part of the lenient parser.

@fmassot
Copy link
Contributor Author

fmassot commented Feb 29, 2024

@trinity-1686a thanks for the explanation. if Lucene considers "john doe AND error" valid, we should consider it valid too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants