# Analyzers

**URL:** <https://discuss.elastic.co/t/analyzers/12752>\
**Category:** Elasticsearch\
**Created:** [July 10, 2013, 9:47pm UTC](https://discuss.elastic.co/t/analyzers/12752 "2013-07-10T21:47:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinh](https://avatars.discourse-cdn.com/v4/letter/v/34f0e0/32.png) [@vinh](https://discuss.elastic.co/u/vinh)\
**Post date:** [July 10, 2013, 9:47pm UTC](https://discuss.elastic.co/t/analyzers/12752/1 "2013-07-10T21:47:03Z")

</div>

Is there a REST API to get the analyzer configuration for a given index? The \_setting API doesn't appear to return this info.

Thanks,  
-Vinh

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![vinh](https://avatars.discourse-cdn.com/v4/letter/v/34f0e0/32.png) [@vinh](https://discuss.elastic.co/u/vinh)\
**Post date:** [July 10, 2013, 9:58pm UTC](https://discuss.elastic.co/t/analyzers/12752/2 "2013-07-10T21:58:44Z")

</div>

Also, is there a REST API to set analyzers to an existing index?

On Jul 10, 2013, at 2:47 PM, vinh [vinh@loggly.com](mailto:vinh@loggly.com) wrote:

> Is there a REST API to get the analyzer configuration for a given index? The \_setting API doesn't appear to return this info.
> 
> Thanks,  
> -Vinh

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [July 11, 2013, 7:05am UTC](https://discuss.elastic.co/t/analyzers/12752/3 "2013-07-11T07:05:41Z")

</div>

Hey,

The settings API returns the analyzer configuration:  
curl -XPUT 'localhost:9200/myindex' -d '{  
"analysis" : {  
"analyzer":{  
"content":{  
"type":"custom",  
"tokenizer":"whitespace"  
}  
}  
}  
}'

curl -X GET 'localhost:9200/myindex/\_settings'  
{"myindex":{"settings":{"index.analysis.analyzer.content.type":"custom","index.analysis.analyzer.content.tokenizer":"whitespace","index.number\_of\_shards":"5","index.number\_of\_replicas":"1","index.version.created":"900299"}}}

Regarding your second question, see  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings/)(end  
of the document) - however I am not sure if this works on the top of  
my head - need to check.

--Alex

On Wed, Jul 10, 2013 at 11:58 PM, vinh [vinh@loggly.com](mailto:vinh@loggly.com) wrote:

> Also, is there a REST API to set analyzers to an existing index?
> 
> On Jul 10, 2013, at 2:47 PM, vinh [vinh@loggly.com](mailto:vinh@loggly.com) wrote:
> 
> > Is there a REST API to get the analyzer configuration for a given index?  
> > The \_setting API doesn't appear to return this info.
> > 
> > Thanks,  
> > -Vinh
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [July 11, 2013, 4:02pm UTC](https://discuss.elastic.co/t/analyzers/12752/4 "2013-07-11T16:02:17Z")

</div>

On Thursday, July 11, 2013 3:05:41 AM UTC-4, Alexander Reelsen wrote:

> Regarding your second question, see  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings/)(end of the document) - however I am not sure if this works on the top of  
> my head - need to check.

It works. I've been using it for the past few days. Like it says, you  
have to close the index and reopen it. From then on new documents will be  
analysed with the new way. If you want to re-analyse your old documents  
you'll have to reindex them all.

--Nik

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [July 11, 2013, 4:26pm UTC](https://discuss.elastic.co/t/analyzers/12752/5 "2013-07-11T16:26:34Z")

</div>

The settings API will not return the analysis settings if they were defined  
in templates.

--  
Ivan

On Thu, Jul 11, 2013 at 12:05 AM, Alexander Reelsen [alr@spinscale.de](mailto:alr@spinscale.de)wrote:

> Hey,
> 
> The settings API returns the analyzer configuration:  
> curl -XPUT 'localhost:9200/myindex' -d '{  
> "analysis" : {  
> "analyzer":{  
> "content":{  
> "type":"custom",  
> "tokenizer":"whitespace"  
> }  
> }  
> }  
> }'
> 
> curl -X GET 'localhost:9200/myindex/\_settings'
> 
> {"myindex":{"settings":{"index.analysis.analyzer.content.type":"custom","index.analysis.analyzer.content.tokenizer":"whitespace","index.number\_of\_shards":"5","index.number\_of\_replicas":"1","index.version.created":"900299"}}}
> 
> Regarding your second question, see  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings/)(end of the document) - however I am not sure if this works on the top of  
> my head - need to check.
> 
> --Alex
> 
> On Wed, Jul 10, 2013 at 11:58 PM, vinh [vinh@loggly.com](mailto:vinh@loggly.com) wrote:
> 
> > Also, is there a REST API to set analyzers to an existing index?
> > 
> > On Jul 10, 2013, at 2:47 PM, vinh [vinh@loggly.com](mailto:vinh@loggly.com) wrote:
> > 
> > > Is there a REST API to get the analyzer configuration for a given  
> > > index? The \_setting API doesn't appear to return this info.
> > > 
> > > Thanks,  
> > > -Vinh
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![vinh](https://avatars.discourse-cdn.com/v4/letter/v/34f0e0/32.png) [@vinh](https://discuss.elastic.co/u/vinh)\
**Post date:** [July 12, 2013, 2:59pm UTC](https://discuss.elastic.co/t/analyzers/12752/6 "2013-07-12T14:59:35Z")

</div>

Thanks all. I'm using the Java API to create indexes, and I provide the settings, analysis, and mappings at that time. This is with CreateIndexRequest and calling setSource() with everything, and explicitly calling setMappings() to ensure it takes the mappings.

There's no errors, and the index appears fine. I suspect thought that it's not taking my analysis config because when I call the settings REST api below to see my analyzers, it's not there.

Going to look at the Java code further. Maybe I need to make another API call to set the analyzers. Would like to avoid that though so that I only need to make a single call to create an index with all its configuration.

On Jul 11, 2013, at 12:05 AM, Alexander Reelsen [alr@spinscale.de](mailto:alr@spinscale.de) wrote:

> Hey,
> 
> The settings API returns the analyzer configuration:  
> curl -XPUT 'localhost:9200/myindex' -d '{  
> "analysis" : {  
> "analyzer":{  
> "content":{  
> "type":"custom",  
> "tokenizer":"whitespace"  
> }  
> }  
> }  
> }'
> 
> curl -X GET 'localhost:9200/myindex/\_settings'  
> {"myindex":{"settings":{"index.analysis.analyzer.content.type":"custom","index.analysis.analyzer.content.tokenizer":"whitespace","index.number\_of\_shards":"5","index.number\_of\_replicas":"1","index.version.created":"900299"}}}
> 
> Regarding your second question, see [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings/) (end of the document) - however I am not sure if this works on the top of my head - need to check.
> 
> --Alex
> 
> On Wed, Jul 10, 2013 at 11:58 PM, vinh [vinh@loggly.com](mailto:vinh@loggly.com) wrote:  
> Also, is there a REST API to set analyzers to an existing index?
> 
> On Jul 10, 2013, at 2:47 PM, vinh [vinh@loggly.com](mailto:vinh@loggly.com) wrote:
> 
> > Is there a REST API to get the analyzer configuration for a given index? The \_setting API doesn't appear to return this info.
> > 
> > Thanks,  
> > -Vinh
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [July 15, 2013, 6:54am UTC](https://discuss.elastic.co/t/analyzers/12752/7 "2013-07-15T06:54:50Z")

</div>

Hey Ivan

what do you mean with this? I just tested defining some analyzers in an  
index template and it is returned correctly in the mapping after index  
creation. Maybe I misunderstood you...

--Alex

On Thu, Jul 11, 2013 at 6:26 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:

> The settings API will not return the analysis settings if they were  
> defined in templates.
> 
> --  
> Ivan
> 
> On Thu, Jul 11, 2013 at 12:05 AM, Alexander Reelsen [alr@spinscale.de](mailto:alr@spinscale.de)wrote:
> 
> > Hey,
> > 
> > The settings API returns the analyzer configuration:  
> > curl -XPUT 'localhost:9200/myindex' -d '{  
> > "analysis" : {  
> > "analyzer":{  
> > "content":{  
> > "type":"custom",  
> > "tokenizer":"whitespace"  
> > }  
> > }  
> > }  
> > }'
> > 
> > curl -X GET 'localhost:9200/myindex/\_settings'
> > 
> > {"myindex":{"settings":{"index.analysis.analyzer.content.type":"custom","index.analysis.analyzer.content.tokenizer":"whitespace","index.number\_of\_shards":"5","index.number\_of\_replicas":"1","index.version.created":"900299"}}}
> > 
> > Regarding your second question, see  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings/)(end of the document) - however I am not sure if this works on the top of  
> > my head - need to check.
> > 
> > --Alex
> > 
> > On Wed, Jul 10, 2013 at 11:58 PM, vinh [vinh@loggly.com](mailto:vinh@loggly.com) wrote:
> > 
> > > Also, is there a REST API to set analyzers to an existing index?
> > > 
> > > On Jul 10, 2013, at 2:47 PM, vinh [vinh@loggly.com](mailto:vinh@loggly.com) wrote:
> > > 
> > > > Is there a REST API to get the analyzer configuration for a given  
> > > > index? The \_setting API doesn't appear to return this info.
> > > > 
> > > > Thanks,  
> > > > -Vinh
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [July 15, 2013, 4:22pm UTC](https://discuss.elastic.co/t/analyzers/12752/8 "2013-07-15T16:22:50Z")

</div>

The analyzer settings definitely do not show up with the Settings API. The  
analyzers themselves are defined in elasticsearch.yml and referenced in an  
index template.

--  
Ivan

On Sun, Jul 14, 2013 at 11:54 PM, Alexander Reelsen [alr@spinscale.de](mailto:alr@spinscale.de)wrote:

> Hey Ivan
> 
> what do you mean with this? I just tested defining some analyzers in an  
> index template and it is returned correctly in the mapping after index  
> creation. Maybe I misunderstood you...
> 
> --Alex
> 
> On Thu, Jul 11, 2013 at 6:26 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:
> 
> > The settings API will not return the analysis settings if they were  
> > defined in templates.
> > 
> > --  
> > Ivan
> > 
> > On Thu, Jul 11, 2013 at 12:05 AM, Alexander Reelsen [alr@spinscale.de](mailto:alr@spinscale.de)wrote:
> > 
> > > Hey,
> > > 
> > > The settings API returns the analyzer configuration:  
> > > curl -XPUT 'localhost:9200/myindex' -d '{  
> > > "analysis" : {  
> > > "analyzer":{  
> > > "content":{  
> > > "type":"custom",  
> > > "tokenizer":"whitespace"  
> > > }  
> > > }  
> > > }  
> > > }'
> > > 
> > > curl -X GET 'localhost:9200/myindex/\_settings'
> > > 
> > > {"myindex":{"settings":{"index.analysis.analyzer.content.type":"custom","index.analysis.analyzer.content.tokenizer":"whitespace","index.number\_of\_shards":"5","index.number\_of\_replicas":"1","index.version.created":"900299"}}}
> > > 
> > > Regarding your second question, see  
> > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings/)(end of the document) - however I am not sure if this works on the top of  
> > > my head - need to check.
> > > 
> > > --Alex
> > > 
> > > On Wed, Jul 10, 2013 at 11:58 PM, vinh [vinh@loggly.com](mailto:vinh@loggly.com) wrote:
> > > 
> > > > Also, is there a REST API to set analyzers to an existing index?
> > > > 
> > > > On Jul 10, 2013, at 2:47 PM, vinh [vinh@loggly.com](mailto:vinh@loggly.com) wrote:
> > > > 
> > > > > Is there a REST API to get the analyzer configuration for a given  
> > > > > index? The \_setting API doesn't appear to return this info.
> > > > > 
> > > > > Thanks,  
> > > > > -Vinh
> > > > 
> > > > --  
> > > > You received this message because you are subscribed to the Google  
> > > > Groups "elasticsearch" group.  
> > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:26am UTC](https://discuss.elastic.co/t/analyzers/12752/9 "2017-07-06T02:26:26Z")

</div>


