-
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
Highlighting on a keyword field not working as expected #82694
Comments
Pinging @elastic/es-search (Team:Search) |
@youngmi-scibite thank you for the report! We intentionally changed this behavior in 7.11 (#63572) because we thought it was most consistent to always normalize For context, is this causing a problem in your application? Or is it just something surprising you noticed while testing different versions? Maybe you could provide more context on the use case. |
Thanks @jtibshirani for the reply! For example, we index first name and surname as keyword type with lowercase normalizer. If I perform searching with an author's name e.g, |
I see, that makes sense. Would it be possible to store the first and last names as I'll also reach out to my teammates to see if they have thoughts/ suggestions. |
@jtibshirani Thanks for coming back with a suggestion. Unfortunately we can't make this change right now. We hope to have an option of getting highlighting done in the previous way. |
We discussed as a team and don't plan to make a change right now. While we understand you prefer the old behavior for your set-up, we don't want to add another option to the API with a separate implementation. We can revisit this decision if we hear from more users that this is a problem. Sorry this isn't the news you were hoping for. I'm closing the issue, but feel free to still add comments. |
Elasticsearch version (
bin/elasticsearch --version
): 7.16.3Plugins installed: [ mapper-annotated-text ]
JVM version (
java -version
):openjdk version "17.0.1"
OS version (
uname -a
if on a Unix-like system):Docker elasticsearch:7.16.3
Description of the problem including expected versus actual behavior:
I have a keyword type field with the lowercase normaliser. When I get highlight on the keyword field, Highlighting seems not to be applied on the
_source
value even though I explicitly setforce_source = true
.Steps to reproduce:
This is the response
What I expected for the highlight value on "tags" is
<em>Elastic</em>
because I set"force_source" : true
in the request and the tags in_source
isElastic
.I have tested different versions
7.8.1
,7.9.0
,7.10.1
return<em>Elastic</em>
7.11.2
,7.12.1
,7.13.4
,7.14.2
,7.16.1
return<em>elastic</em>
Provide logs (if relevant):
The text was updated successfully, but these errors were encountered: