-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Elasticsearch accepts and stores floats in keyword mapped field #34222
Comments
Note that what gets returned is the |
Pinging @elastic/es-search-aggs |
As @javanna explained we always coerce numerics into strings if the field is mapped as a |
Seems to me like the default of coerce=true has the potential of hiding bugs in how people are mapping their fields (or how they are sending the data). Seems like either the mapping or the data is wrong if a user is sending 10.0 as a value for a field intended to be a keyword. Maybe I'm not thinking of some valid use case where someone would legitimately be doing this though. |
This is one of the many cases where there is a balance between the getting started experience (being able to get data into Elasticsearch quickly without having to jump through many hoops) and production protection. In the past we have erred on the side of the getting started experience with this and thats why the default is Noted that there is currently no |
In #25861, we decided to remove the |
We've decided to close this issue and keep the current behavior. If we receive more feedback that the behavior is confusing, we can revisit this choice (keeping in mind consistency across different field types as @colings86 mentioned). |
Elasticsearch version (
bin/elasticsearch --version
): 7.0.0-alpha1 (also 6.4)Plugins installed: []
JVM version (
java -version
):OS version (
uname -a
if on a Unix-like system):Description of the problem including expected versus actual behavior:
Related to: elastic/kibana#23530
Steps to reproduce:
Last command returns:
Note that a keyword field has accepted a float and preserved it as such in returning it. I think ES should either reject the PUT of this document or coerce the float into a string.
Provide logs (if relevant):
The text was updated successfully, but these errors were encountered: