-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Integer/long mapping is trappy for ID-based fields #49538
Comments
Pinging @elastic/es-search (:Search/Mapping) |
I ran some quick benchmarks and |
We discussed this in FixItFriday. As far as changes go we should update the following docs to share the "map numerics as keyword" advice for improving exact-matching: |
Pinging @elastic/es-docs (>docs) |
I'll work on adding this documentation. |
It seems like it would be beneficial to add a tip to the |
Hi @jdcohen220 Thank you for your feedback. Do you mind creating a separate issue with some steps for reproduction? While both involve the Thanks again. |
Saw another example of someone falling into the trap of mapping fields as longs when they are queried for exact-values rather than ranges. These are better mapped as keyword fields.
It's a trap that is too easy to fall into - "I have a long field so I just map it as a long-value, right?"
I can think of 4 ways to address the problem:
long_quantity
orlong_identifier
to express the usage of a long number (quantities are things like prices or durations and are optimised for range queries whereas identifiers are looked up by exact matches)An advantage of 2) is that I imagine we can have more optimised storage than string-based keyword for long_identifier types?
The text was updated successfully, but these errors were encountered: