Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Highlighting does not work when all fields are type keyword #21636
Elasticsearch version: 5.0
Plugins installed: N/A
JVM version: 1.8u112
OS version: Windows Server 2012
Description of the problem including expected versus actual behavior: Highlighting dynamic fields which are stored as keyword is not working as expected. When searching over _all I would expect highlighting to occur on all fields of the result when using
My use case is that nearly every search is done for an exact value or over _all. I could get extreme performance gains by shifting dynamically created fields to Keyword, and then if full-text search is needed, defining them explicitly in the mapping. However, search highlighting is still an important part of our workflow.
Do I have a misunderstanding of how highlighting works? My interpretation is that
Steps to reproduce:
Expected: There should be highlighted search text extracted from the _source fields that are loaded at highlight-time
The same can be repeated where the search is an exact match for the field, and no highlighting is done then either.
Ok now I understand the problem @nostrebor
This is due to the fact that the keyword field is stored as a binary field. The highlighter does not convert the binary value into a valid string.
... or you can force highlighting on source: