-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Update semantics or definition of case_insensitive
in term queries
#63893
Comments
Pinging @elastic/es-search (:Search/Search) |
…ueries to an enum. Closes elastic#63893
Following up on our discussion - we agreed to keep the
How does this sound? |
Sounds good. Should we be a bit more specific about |
It becomes an "it depends" answer which goes beyond choice of analyzers and unfortunately includes choice of fields.
That's probably more detail than we want to get into in this short description. |
The problem you outlined is more a discrepancy that we have in the term-based queries since we don't apply normalization on text field whereas we do on keyword fields. So IMO we should apply normalization all the time to make the behavior consistent and change the documentation of the case_insensitive option to |
Obviously for another issue. We closed this keyword issue with that comment about addressing it in future. |
…lastic#63926) * Remove errors when case_insensitive flag set to false Closes elastic#63893
…lastic#63926) * Remove errors when case_insensitive flag set to false Closes elastic#63893
PR #61596 added a new
case_insensitive
boolean flag to term queries. This is a boolean flag that can only be set totrue
, which is rather unusual.After talking to @markharwood it turns out the semantics of this flag is as follows:
true
: case insensitivefalse
: not supported as we can't enforce case sensitivity if the field has been normalized with a lowercase normalizer.From a Clients perspective, this makes this flag very much a snowflake. We can represent it as an optional boolean, but users will still have to be aware that this boolean, when set, can only be set to
true
. If the value for this flag comes from an application variable like a checkbox in a search dialog, users will have to add some logic to only set it iftrue
and not iffalse
.So I suggest that we either change the semantics of this flag (and update the docs accordingly) or change its definition.
Change semantics:
true
: case insensitivefalse
: use the field's definitionChange definition: rename it to
case_sensitivity
with valuesfield_default
- use the field's settinginsensitive
- case insensitivesensitive
if that make sense.Changing the semantics can be enough if we're sure that
sensitive
doesn't (and will never) make sense, and will just be about updating the doc and removing some validation checks.The enumeration will still require some custom logic in applications, but won't be surprising as it will be a type conversion from a boolean (checkbox) to an enum.
/cc @markharwood @jimczi
The text was updated successfully, but these errors were encountered: