Open fax4ever opened 5 years ago
Pinging @elastic/es-search
We discussed this internally and agreed that the behavior should be consistent with the normalization that is applied on term
queries that target a keyword
field. However we're unsure if the change should be treated as a bug or a breaking change since users might rely on the non-normalized value to define the missing value. While we agree that this behavior is not consistent and that we should normalize the value all the time we were also wondering for which use case this option was used because we expect _first
and _last
missing mode to be used more widely for a keyword field than a custom value ?
Hi,
I'm part of the same team as @fax4ever so I'll answer while he's away.
Long story short, our use case is a Java library (Hibernate Search) that exposes Elasticsearch's features through a different API, along with other, database-related features. So we don't have a specific use case, it's more that the behavior was inconsistent with what we expected, and that showed up in our integration tests.
That being said, if an actual use case is necessary, I can imagine a web UI displaying a sorted list where missing values for a keyword field are displayed as "Missing", even though they are indexed as null. If the customer requires that entries with this "Missing" label are just after "L..." and just before "N...", then using "missing": "Missing"
would help. The developers could hard-code normalization in their app (use "missing": "missing"
), but that's arguably not very developer-friendly.
Pinging @elastic/es-search (Team:Search)
Pinging @elastic/es-search-relevance (Team:Search Relevance)
Describe the feature:
Normalize the sort missing values if a normalizer is defined for the field.
Elasticsearch version (
bin/elasticsearch --version
):7.0.0
Plugins installed: []
JVM version (
java -version
):java version "1.8.0_171" Java(TM) SE Runtime Environment (build 1.8.0_171-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
OS version (
uname -a
if on a Unix-like system):Linux new-host 5.0.6-100.fc28.x86_64 #1 SMP Wed Apr 3 16:14:34 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Description of the problem including expected versus actual behavior:
About missing values provided in a sort predicates. If a normizer is defined on the field, those values are not normalized.
Steps to reproduce:
Please include a minimal but complete recreation of the problem, including (e.g.) index creation, mappings, settings, query etc. The easier you make for us to reproduce it, the more likely that somebody will take the time to look at it.
Provide logs (if relevant):