ES version: 5.5.2
I've created index like this:
{
"settings": {
"index": {
"analysis": {
"normalizer": {
"normalizer_lower": {
"type": "custom",
"filter": ["lowercase"]
},
"normalizer_upper": {
"type": "custom",
"filter": ["uppercase"]
}
}
}}
},
"mappings": {
"t": {
"properties": {
"kw_upper": {
"type": "keyword",
"normalizer": "normalizer_upper",
"ignore_above": 256,
"store": false
},
"kw_lower": {
"type": "keyword",
"normalizer": "normalizer_lower",
"ignore_above": 256,
"store": false
},"kw_lower_store": {
"type": "keyword",
"normalizer": "normalizer_lower",
"ignore_above": 256,
"store": true
}
}
}
}
}
and put documents like these:
{ "index" : {"_id" : "1", "_type" : "t", "_index" : "test"}}
{"kw_lower": "lower.123", "kw_upper": "lower.123", "kw_lower_store": "lower.123"}
{ "index" : {"_id" : "2", "_type" : "t", "_index" : "test"}}
{"kw_lower": "UPPER.123", "kw_upper": "UPPER.123", "kw_lower_store": "UPPER.123"}
when I search "uppercase" normalized field with uppercased value ("UPPER.123")
it highlights kw_upper and kw_lower_store field only but not kw_lower.
when I search "lowercase" normalized field with lowercased value ("lower.123")
it highlights kw_lower and kw_lower_store field only but not kw_upper.
Is this by design? If so where may I find that in documentation?
Unless I misunderstand this note in doc. Doc states:
In order to perform highlighting, the actual content of the field is required. If the field in question is stored (has store set to true in the mapping) it will be used, otherwise, the actual _source will be loaded and the relevant field will be extracted from it.
the value is stored in _source so I expect that it works without store=true
.