# Html\_strip and lowercase on keyword analyzed fields

**URL:** <https://discuss.elastic.co/t/html-strip-and-lowercase-on-keyword-analyzed-fields/58506>\
**Category:** Elasticsearch\
**Created:** [August 20, 2016, 1:31pm UTC](https://discuss.elastic.co/t/html-strip-and-lowercase-on-keyword-analyzed-fields/58506 "2016-08-20T13:31:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hitesh-inbetween](https://avatars.discourse-cdn.com/v4/letter/h/51bf81/32.png) [@hitesh-inbetween](https://discuss.elastic.co/u/hitesh-inbetween)\
**Post date:** [August 20, 2016, 1:31pm UTC](https://discuss.elastic.co/t/html-strip-and-lowercase-on-keyword-analyzed-fields/58506/1 "2016-08-20T13:31:02Z")

</div>

Hey guys,  
I tried to apply html\_strip and lowercase filter on a keyword analyzed field. While searching i noticed that the search results are not as expected.

This is the index that we tried to create

`PUT /test_index { "settings": { "number_of_shards": 5, "number_of_replicas": 0, "analysis": { "analyzer": { "ExportPrimaryAnalyzer": { "type": "custom", "tokenizer": "whitespace", "filter": "lowercase", "char_filter": "html_strip" }, "ExportRawAnalyzer": { "type": "custom", "buffer_size": "1000", "tokenizer": "keyword", "filter": "lowercase", "char_filter": "html_strip" } } } }, "mappings": { "test_type": { "properties": { "city": { "type": "string", "analyzer" : "ExportPrimaryAnalyzer" }, "city_raw":{ "type": "string", "analyzer" : "ExportRawAnalyzer" } } } } }`

And following is the data example :

`PUT test_index/test_type/4 { "city": "<p>I am from Pune</p>", "city_raw": "<p>I am from Pune</p>" }`

When we try to do wildcard on it, we are not getting results. Following is the query we tried to fire.

`{ "query": { "wildcard": { "city_raw": "i am*" } } }`

Any help appreciated

---

<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:** [July 5, 2017, 10:26pm UTC](https://discuss.elastic.co/t/html-strip-and-lowercase-on-keyword-analyzed-fields/58506/2 "2017-07-05T22:26:25Z")

</div>


