# How to achieve global analyzer per index

**URL:** <https://discuss.elastic.co/t/how-to-achieve-global-analyzer-per-index/64999>\
**Category:** Elasticsearch\
**Created:** [November 4, 2016, 9:51am UTC](https://discuss.elastic.co/t/how-to-achieve-global-analyzer-per-index/64999 "2016-11-04T09:51:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![makeyang](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@makeyang](https://discuss.elastic.co/u/makeyang)\
**Post date:** [November 4, 2016, 9:51am UTC](https://discuss.elastic.co/t/how-to-achieve-global-analyzer-per-index/64999/1 "2016-11-04T09:51:32Z")

</div>

try this one:  
put twitter2' -d' {  
"index" : {  
"analysis" : {  
"analyzer" : {  
"default" : {  
"type" : "keyword"  
}  
}  
}  
},  
"mapping": {}  
}

and it won't work.  
can anyone show me how to achieve so?

---

<div class="post-metadata">

**Author:** ![xavierfacq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xavierfacq/32/8744_2.png) [@xavierfacq](https://discuss.elastic.co/u/xavierfacq)\
**Post date:** [November 4, 2016, 11:07am UTC](https://discuss.elastic.co/t/how-to-achieve-global-analyzer-per-index/64999/2 "2016-11-04T11:07:50Z")

</div>

Try using a template:

```
{
    "template" : "your-index-names-*",
    "settings" : {
        "analysis": {
            "analyzer": {
                "default": {
                    "type": "keyword"
                }
            }
    }
    ...
}
```

---

<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:06pm UTC](https://discuss.elastic.co/t/how-to-achieve-global-analyzer-per-index/64999/3 "2017-07-05T22:06:34Z")

</div>


