# Special characters for ngram

**URL:** https://discuss.elastic.co/t/special-characters-for-ngram/148866
**Category:** Elasticsearch
**Created:** [September 17, 2018, 5:43pm UTC](https://discuss.elastic.co/t/special-characters-for-ngram/148866 "2018-09-17T17:43:29Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![adibha123](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adibha123/32/35500_2.png) [@adibha123](https://discuss.elastic.co/u/adibha123)
#### Post date: [September 17, 2018, 5:43pm UTC](https://discuss.elastic.co/t/special-characters-for-ngram/148866/1 "2018-09-17T17:43:29Z")

</div>

{  
"template" : "spectre\*",  
"settings": {  
"analysis": {  
"filter": {  
"custom\_filter": {  
"type": "mapping",  
"mappings": [  
"& =\> ALPHA"  
]  
}  
},  
"analyzer" : {  
"autocomplete" : {  
"tokenizer" : "autocomplete\_tokenizer",  
"filter" : [  
"uppercase"  
]  
},  
"autocomplete\_search" : {  
"tokenizer" : "standard",  
"filter" : [  
"uppercase",  
"custom\_filter"  
]  
},  
"comma" : {  
"tokenizer": "comma\_tokenizer"  
}  
},  
"tokenizer" : {  
"autocomplete\_tokenizer" : {  
"type" : "edge\_ngram",  
"min\_gram" : 1,  
"max\_gram" : 20,  
"token\_chars" : [  
"letter",  
"digit",  
"symbol",  
"punctuation"  
]  
},  
"comma\_tokenizer" : {  
"type": "pattern",  
"pattern": ","  
}  
}  
},  
"index.refresh\_interval" : "5s",  
"index.max\_result\_window" : "1000000"  
},  
"mappings" : {  
"_default_" : {  
"\_all" : { "enabled" : false },  
"dynamic\_templates" : [ {  
"strings\_as\_keywords" : {  
"match" : "\*",  
"match\_mapping\_type" : "string",  
"mapping" : {  
"type" : "text",  
"norms" : false,  
"fields" : {  
"keyword" : {  
"type" : "keyword"  
}  
}  
}  
}  
} ]  
},  
"company" : {  
"properties" : {  
"entityId": {  
"type": "text",  
"boost": 3,  
"fields": {  
"keyword": {  
"type": "keyword"  
}  
}  
},  
"entityTypeId" : {  
"type" : "text",  
"analyzer": "comma"  
},  
"name" : {  
"type" : "text",  
"boost": 2,  
"analyzer" : "autocomplete",  
"search\_analyzer" : "autocomplete\_search",  
"fields" : {  
"keyword" : {  
"type" : "keyword"  
}  
}  
},  
"nameAlt" : {  
"type" : "text",  
"analyzer" : "autocomplete",  
"search\_analyzer" : "autocomplete\_search",  
"fields" : {  
"keyword" : {  
"type" : "keyword"  
}  
}  
},  
"rssdId": {  
"type": "text",  
"boost": 4,  
"fields": {  
"keyword": {  
"type": "keyword"  
}  
}  
},  
"ticker" : {  
"type" : "text",  
"boost": 4,  
"analyzer" : "autocomplete\_search",  
"search\_analyzer" : "autocomplete\_search",  
"fields" : {  
"keyword" : {  
"type" : "keyword"  
}  
}  
}  
}  
}  
}  
}

This index is not loading when try to create index, usecase is to do text search, tokenized with special characters like (, ) and &

---

<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: [October 15, 2018, 5:43pm UTC](https://discuss.elastic.co/t/special-characters-for-ngram/148866/2 "2018-10-15T17:43:35Z")

</div>

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