# Define analyzer globally

**URL:** <https://discuss.elastic.co/t/define-analyzer-globally/12283>\
**Category:** Elasticsearch\
**Created:** [June 5, 2013, 4:20pm UTC](https://discuss.elastic.co/t/define-analyzer-globally/12283 "2013-06-05T16:20:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dp\_desoma](https://avatars.discourse-cdn.com/v4/letter/d/ccd318/32.png) [@dp\_desoma](https://discuss.elastic.co/u/dp_desoma)\
**Post date:** [June 5, 2013, 4:20pm UTC](https://discuss.elastic.co/t/define-analyzer-globally/12283/1 "2013-06-05T16:20:56Z")

</div>

Hi,

I'm using version 0.90.0.

I need/want to define my custom analyzers globally. therefore I edited the  
configuration file of ES (elasticsearch.yml) according to this answer: Can  
I customize Elastic Search to use my own Stop Word list?[http://stackoverflow.com/questions/4927629/can-i-customize-elastic-search-to-use-my-own-stop-word-list/13012458#13012458](http://stackoverflow.com/questions/4927629/can-i-customize-elastic-search-to-use-my-own-stop-word-list/13012458#13012458)the relevant entries are

index.analysis.analyzer.angram:  
type: custom  
tokenizer: standard  
filter: standard, lowercase, fngram  
index.analysis.filter.fngram:  
type: nGram  
min\_gram: 2  
max\_gram: 10

but when I try to invoke curl -XGET  
'localhost:9200/\_analyze?analyzer=angram' -d 'this is a test' I get an ElasticSearchIllegalARgumentException[failed  
to find analyzer [angram]].

is the configuration wrong? (although I'd expect ES to not start-up when  
encountered an error when reading the configuration during start-up)

how do I correctly define an analyzer globally?

Thanks for your time.

BR, dp  
PS: I asked the question @ stackoverflow as well  
([http://stackoverflow.com/questions/16913073/define-analyzer-globally-es](http://stackoverflow.com/questions/16913073/define-analyzer-globally-es))  
PPS: I found that viewing of all settings is not yet possible (but an issue  
was created here: [https://github.com/elasticsearch/elasticsearch/issues/2738](https://github.com/elasticsearch/elasticsearch/issues/2738)[https://github.com/elasticsearch/elasticsearch/issues/2738](https://github.com/elasticsearch/elasticsearch/issues/2738) )  
which would be nice to double-check.

--  
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:** [June 5, 2013, 4:24pm UTC](https://discuss.elastic.co/t/define-analyzer-globally/12283/2 "2013-06-05T16:24:06Z")

</div>

You cannot use a custom analyzer until it is referenced by an index. You  
would need to create a mapping that uses the analyzer and then use that  
index in the analyzer call. There is no need to index any documents to that  
index.

curl -XGET 'localhost:9200/_SOMEINDEX_/\_analyze?analyzer=angram'

--  
Ivan

On Wed, Jun 5, 2013 at 9:20 AM, [dp.desoma@gmail.com](mailto:dp.desoma@gmail.com) wrote:

> Hi,
> 
> I'm using version 0.90.0.
> 
> I need/want to define my custom analyzers globally. therefore I edited the  
> configuration file of ES (elasticsearch.yml) according to this answer: Can  
> I customize Elastic Search to use my own Stop Word list?[http://stackoverflow.com/questions/4927629/can-i-customize-elastic-search-to-use-my-own-stop-word-list/13012458#13012458](http://stackoverflow.com/questions/4927629/can-i-customize-elastic-search-to-use-my-own-stop-word-list/13012458#13012458)the relevant entries are
> 
> index.analysis.analyzer.angram:  
> type: custom  
> tokenizer: standard  
> filter: standard, lowercase, fngram  
> index.analysis.filter.fngram:  
> type: nGram  
> min\_gram: 2  
> max\_gram: 10
> 
> but when I try to invoke curl -XGET  
> 'localhost:9200/\_analyze?analyzer=angram' -d 'this is a test' I get an ElasticSearchIllegalARgumentException[failed  
> to find analyzer [angram]].
> 
> is the configuration wrong? (although I'd expect ES to not start-up when  
> encountered an error when reading the configuration during start-up)
> 
> how do I correctly define an analyzer globally?
> 
> Thanks for your time.
> 
> BR, dp  
> PS: I asked the question @ stackoverflow as well (  
> [elasticsearch - define analyzer globally (ES) - Stack Overflow](http://stackoverflow.com/questions/16913073/define-analyzer-globally-es))  
> PPS: I found that viewing of all settings is not yet possible (but an  
> issue was created here: h  
> ttps://github.com/elasticsearch/elasticsearch/issues/2738[https://github.com/elasticsearch/elasticsearch/issues/2738](https://github.com/elasticsearch/elasticsearch/issues/2738) )  
> which would be nice to double-check.
> 
> --  
> 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:** ![dp\_desoma](https://avatars.discourse-cdn.com/v4/letter/d/ccd318/32.png) [@dp\_desoma](https://discuss.elastic.co/u/dp_desoma)\
**Post date:** [June 5, 2013, 4:56pm UTC](https://discuss.elastic.co/t/define-analyzer-globally/12283/3 "2013-06-05T16:56:23Z")

</div>

Thank you!

On Wednesday, June 5, 2013 6:24:06 PM UTC+2, Ivan Brusic wrote:

> You cannot use a custom analyzer until it is referenced by an index. You  
> would need to create a mapping that uses the analyzer and then use that  
> index in the analyzer call. There is no need to index any documents to that  
> index.
> 
> curl -XGET 'localhost:9200/_SOMEINDEX_/\_analyze?analyzer=angram'
> 
> --  
> Ivan
> 
> On Wed, Jun 5, 2013 at 9:20 AM, \<[dp.d...@gmail.com](mailto:dp.d...@gmail.com) \<javascript:\>\> wrote:
> 
> > Hi,
> > 
> > I'm using version 0.90.0.
> > 
> > I need/want to define my custom analyzers globally. therefore I edited  
> > the configuration file of ES (elasticsearch.yml) according to this answer: Can  
> > I customize Elastic Search to use my own Stop Word list?[http://stackoverflow.com/questions/4927629/can-i-customize-elastic-search-to-use-my-own-stop-word-list/13012458#13012458](http://stackoverflow.com/questions/4927629/can-i-customize-elastic-search-to-use-my-own-stop-word-list/13012458#13012458)the relevant entries are
> > 
> > index.analysis.analyzer.angram:  
> > type: custom  
> > tokenizer: standard  
> > filter: standard, lowercase, fngram  
> > index.analysis.filter.fngram:  
> > type: nGram  
> > min\_gram: 2  
> > max\_gram: 10
> > 
> > but when I try to invoke curl -XGET  
> > 'localhost:9200/\_analyze?analyzer=angram' -d 'this is a test' I get an ElasticSearchIllegalARgumentException[failed  
> > to find analyzer [angram]].
> > 
> > is the configuration wrong? (although I'd expect ES to not start-up when  
> > encountered an error when reading the configuration during start-up)
> > 
> > how do I correctly define an analyzer globally?
> > 
> > Thanks for your time.
> > 
> > BR, dp  
> > PS: I asked the question @ stackoverflow as well (  
> > [elasticsearch - define analyzer globally (ES) - Stack Overflow](http://stackoverflow.com/questions/16913073/define-analyzer-globally-es))  
> > PPS: I found that viewing of all settings is not yet possible (but an  
> > issue was created here: h  
> > ttps://github.com/elasticsearch/elasticsearch/issues/2738[https://github.com/elasticsearch/elasticsearch/issues/2738](https://github.com/elasticsearch/elasticsearch/issues/2738) )  
> > which would be nice to double-check.
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > 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:32am UTC](https://discuss.elastic.co/t/define-analyzer-globally/12283/4 "2017-07-06T02:32:43Z")

</div>


