# Templates to include settings

**URL:** <https://discuss.elastic.co/t/templates-to-include-settings/10435>\
**Category:** Elasticsearch\
**Created:** [January 21, 2013, 9:08am UTC](https://discuss.elastic.co/t/templates-to-include-settings/10435 "2013-01-21T09:08:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohammady\_Mahdy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mohammady_mahdy/32/2128_2.png) [@Mohammady\_Mahdy](https://discuss.elastic.co/u/Mohammady_Mahdy)\
**Post date:** [January 21, 2013, 9:08am UTC](https://discuss.elastic.co/t/templates-to-include-settings/10435/1 "2013-01-21T09:08:56Z")

</div>

Hi,

I have a working deployment using elasticsearch on a medium scale (500  
million docs so far and growing), It's pretty much your standard log  
scenario so we opted for the index per day design. It works perfectly, we  
had a template that matches index names 'mylog\*' and it just had the  
correct mapping for every index. Only problem is when I started using a  
custom analyzers I couldn't get those to be set by the template (had a  
settings section, and upon creation I get the right mapping but not  
analyzers). I was wondering if someone can point me to how to do this. Is  
there a place where I can define my analyzers globally in file and just  
refer to them from the template instead of trying to define them everytime?

--

---

<div class="post-metadata">

**Author:** ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)\
**Post date:** [January 21, 2013, 2:55pm UTC](https://discuss.elastic.co/t/templates-to-include-settings/10435/2 "2013-01-21T14:55:12Z")

</div>

On Mon, Jan 21, 2013 at 11:08 AM, Mo [mohammady.mahdy@gmail.com](mailto:mohammady.mahdy@gmail.com) wrote:

> Hi,
> 
> I have a working deployment using elasticsearch on a medium scale (500  
> million docs so far and growing), It's pretty much your standard log  
> scenario so we opted for the index per day design. It works perfectly, we  
> had a template that matches index names 'mylog\*' and it just had the  
> correct mapping for every index. Only problem is when I started using a  
> custom analyzers I couldn't get those to be set by the template (had a  
> settings section, and upon creation I get the right mapping but not  
> analyzers). I was wondering if someone can point me to how to do this. Is  
> there a place where I can define my analyzers globally in file and just  
> refer to them from the template instead of trying to define them everytime?
> 
> --

--  
[http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

--

---

<div class="post-metadata">

**Author:** ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)\
**Post date:** [January 21, 2013, 2:57pm UTC](https://discuss.elastic.co/t/templates-to-include-settings/10435/3 "2013-01-21T14:57:23Z")

</div>

Retry 🙂

OK, so I don't know of an option to do exactly what you want, but you can  
define multiple templates, and the new indices will try to merge those  
settings. So you can have a template that matches "\*" with your analyzer  
settings, and different templates with your other settings.

## Best regards, Radu

[http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

On Mon, Jan 21, 2013 at 4:55 PM, Radu Gheorghe  
[radu.gheorghe@sematext.com](mailto:radu.gheorghe@sematext.com)wrote:

> On Mon, Jan 21, 2013 at 11:08 AM, Mo [mohammady.mahdy@gmail.com](mailto:mohammady.mahdy@gmail.com) wrote:
> 
> > Hi,
> > 
> > I have a working deployment using elasticsearch on a medium scale (500  
> > million docs so far and growing), It's pretty much your standard log  
> > scenario so we opted for the index per day design. It works perfectly, we  
> > had a template that matches index names 'mylog\*' and it just had the  
> > correct mapping for every index. Only problem is when I started using a  
> > custom analyzers I couldn't get those to be set by the template (had a  
> > settings section, and upon creation I get the right mapping but not  
> > analyzers). I was wondering if someone can point me to how to do this. Is  
> > there a place where I can define my analyzers globally in file and just  
> > refer to them from the template instead of trying to define them everytime?
> > 
> > --
> 
> --  
> [http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

--

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [January 21, 2013, 3:32pm UTC](https://discuss.elastic.co/t/templates-to-include-settings/10435/4 "2013-01-21T15:32:48Z")

</div>

You can define your custom analyzers in elasticsearch.yml and use them in  
any index.

--  
Ivan  
On Jan 21, 2013 1:09 AM, "Mo" [mohammady.mahdy@gmail.com](mailto:mohammady.mahdy@gmail.com) wrote:

> Hi,
> 
> I have a working deployment using elasticsearch on a medium scale (500  
> million docs so far and growing), It's pretty much your standard log  
> scenario so we opted for the index per day design. It works perfectly, we  
> had a template that matches index names 'mylog\*' and it just had the  
> correct mapping for every index. Only problem is when I started using a  
> custom analyzers I couldn't get those to be set by the template (had a  
> settings section, and upon creation I get the right mapping but not  
> analyzers). I was wondering if someone can point me to how to do this. Is  
> there a place where I can define my analyzers globally in file and just  
> refer to them from the template instead of trying to define them everytime?
> 
> --

--

---

<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 6, 2017, 2:55am UTC](https://discuss.elastic.co/t/templates-to-include-settings/10435/5 "2017-07-06T02:55:25Z")

</div>


