Skip to content

Remove boolean query parsing leniency #21545

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

Closed
dakrone opened this issue Nov 14, 2016 · 1 comment
Closed

Remove boolean query parsing leniency #21545

dakrone opened this issue Nov 14, 2016 · 1 comment
Labels
>breaking :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v6.0.0-alpha1

Comments

@dakrone
Copy link
Member

dakrone commented Nov 14, 2016

Currently when querying a boolean field, we parse pretty much anything except for false or 0 to mean true. This can cause a lot of query confusion.

We should remove this boolean parsing leniency so that only the string "true" and "false" parse without exceptions.

@dakrone dakrone added :Search Foundations/Mapping Index mappings, including merging and defining field types >breaking v6.0.0-alpha1 labels Nov 14, 2016
@jpountz
Copy link
Contributor

jpountz commented Nov 14, 2016

For the record, this is an issue when running queries on multiple fields and the field list includes a boolean field, since everything but false/0 parses to true. We'd rather like to ignore such fields, which would only works if an error was raised, just like what happens when searching for a random string value on a numeric field.

@dakrone dakrone changed the title Remove boolean parsing leniency Remove boolean query parsing leniency Nov 14, 2016
dakrone added a commit to dakrone/elasticsearch that referenced this issue Nov 14, 2016
This changes only the query parsing behavior to be strict when searching on
boolean values. We continue to accept the variety of values during index time,
but searches will only be parsed using `"true"` or `"false"`.

Resolves elastic#21545
dakrone added a commit that referenced this issue Nov 15, 2016
This changes only the query parsing behavior to be strict when searching on
boolean values. We continue to accept the variety of values during index time,
but searches will only be parsed using `"true"` or `"false"`.

Resolves #21545
@javanna javanna added the Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>breaking :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v6.0.0-alpha1
Projects
None yet
Development

No branches or pull requests

3 participants