# Highlighting not working with keyword normalizer

**URL:** https://discuss.elastic.co/t/highlighting-not-working-with-keyword-normalizer/97571
**Category:** Elasticsearch
**Created:** [August 18, 2017, 11:34am UTC](https://discuss.elastic.co/t/highlighting-not-working-with-keyword-normalizer/97571 "2017-08-18T11:34:42Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![daviddd](https://avatars.discourse-cdn.com/v4/letter/d/848f3c/32.png) [@daviddd](https://discuss.elastic.co/u/daviddd)
#### Post date: [August 18, 2017, 11:34am UTC](https://discuss.elastic.co/t/highlighting-not-working-with-keyword-normalizer/97571/1 "2017-08-18T11:34:42Z")

</div>

[CUT]  
When i set a normalizer with lowercase filter for a field with keyword data type, the highlighting for this field doesn't work. If i create mapping without setting normalizer property of keyword data type, it works. Because of case insensitive search on keyword field, i set the normalizer property and search query works very well, but highlighting doesn't work anymore.  
[/CUT]

Python:

```
# https://discuss.elastic.co/t/insensitive-case-sort-error-mapping-definition-for-fields-has-unsupported
# -parameters-analyzer-case-insensitive-sort/71877/3
normalizers['lowercase_normalizer'] = {
    'type': 'custom',
    'filter': ['lowercase', 'asciifolding']
}

```

Mappings:

`'name': {'normalizer': 'lowercase_normalizer', 'type': 'keyword', 'doc_values': False},`  
or  
`'keywords': {'normalizer': 'lowercase_normalizer', 'type': 'keyword'},`

Linked to this:

> [@Highlighting problem with keyword normalizer](https://discuss.elastic.co/t/highlighting-problem-with-keyword-normalizer/84880):
>
> Hi, When i set a normalizer with lowercase filter for a field with keyword data type, the highlighting for this field doesn't work. If i create mapping without setting normalizer property of keyword data type, it works. Because of case insensitive search on keyword field, i set the normalizer property and search query works very well, but highlighting doesn't work anymore. Do you know why?

Any idea?

Thanks,

David

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [September 15, 2017, 11:34am UTC](https://discuss.elastic.co/t/highlighting-not-working-with-keyword-normalizer/97571/2 "2017-09-15T11:34:48Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
