# Search - keyword vs text and ngram

**URL:** <https://discuss.elastic.co/t/search-keyword-vs-text-and-ngram/271606>\
**Category:** Elasticsearch\
**Created:** [April 29, 2021, 9:21am UTC](https://discuss.elastic.co/t/search-keyword-vs-text-and-ngram/271606 "2021-04-29T09:21:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lele15](https://avatars.discourse-cdn.com/v4/letter/l/ea5d25/32.png) [@lele15](https://discuss.elastic.co/u/lele15)\
**Post date:** [April 29, 2021, 9:21am UTC](https://discuss.elastic.co/t/search-keyword-vs-text-and-ngram/271606/1 "2021-04-29T09:21:36Z")

</div>

Hi, I have an index like:

> "name": {  
> "type": "keyword"  
> },  
> "address": {  
> "type": "keyword"  
> },  
> "addressText": {  
> "type": "text",  
> "analyzer": "autocomplete",  
> "search\_analyzer": "autocomplete\_search"  
> },  
> "nameText": {  
> "type": "text",  
> "analyzer": "autocomplete",  
> "search\_analyzer": "autocomplete\_search"  
> },

autocomplete\_search

> "autocomplete\_filter": {  
> "type": "edge\_ngram",  
> "min\_gram": 1,  
> "max\_gram": 50,  
> "token\_chars": [  
> "letter"  
> ]  
> }

I use "Text" fields for autocomplete and normal fields for exact match. I have a problem with special character when i use keyword type for search.

For the exact match, i use the entire word and I have a problem with so many special character, i have data from all languages, like ( ' , - , \_ ) for example.

thank you in advance for your support.

---

<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:** [May 27, 2021, 9:22am UTC](https://discuss.elastic.co/t/search-keyword-vs-text-and-ngram/271606/2 "2021-05-27T09:22:37Z")

</div>

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