# Listing available analyzers via API

**URL:** <https://discuss.elastic.co/t/listing-available-analyzers-via-api/16472>\
**Category:** Elasticsearch\
**Created:** [March 19, 2014, 4:46pm UTC](https://discuss.elastic.co/t/listing-available-analyzers-via-api/16472 "2014-03-19T16:46:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kevin\_Blaisdell](https://avatars.discourse-cdn.com/v4/letter/k/e9c0ed/32.png) [@Kevin\_Blaisdell](https://discuss.elastic.co/u/Kevin_Blaisdell)\
**Post date:** [March 19, 2014, 4:46pm UTC](https://discuss.elastic.co/t/listing-available-analyzers-via-api/16472/1 "2014-03-19T16:46:39Z")

</div>

The scenario I have is driving some index builds from an external  
application. As part of this an analyzer would be chosen in the external  
application. The intent here would be that a choice could be made from a  
list of all analyzers available in the ES installation whether distributed  
with ES or custom configured by someone on that particular installation.

To my surprise there doesn't seem to be a way via API to get a listing of  
the available analyzers?

I do understand I can look at the source or the documentation to see the  
default ones, but I am looking for a programatic, run time way to find what  
is available. Am I missing something in the API or will I have to look at  
creating a plugin to add this capability?

Kevin

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/cd781459-16ec-4319-be29-52c3b9979e31%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/cd781459-16ec-4319-be29-52c3b9979e31%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [March 19, 2014, 5:48pm UTC](https://discuss.elastic.co/t/listing-available-analyzers-via-api/16472/2 "2014-03-19T17:48:31Z")

</div>

I do not think there is anything in the API, but if you are running Java,  
you can create a IndicesAnalysisService locally (see the unit tests for an  
example) and then call analyzerProviderFactories() to get the various  
prebuilt analyzer factories. This only works for the standard analyzers,  
not any analyzers installed via plugins. For those, you would need to use  
the AnalysisService around an existing index (not as clean).

An API wrapper around the IndicesAnalysisService could make sense.

--  
Ivan

On Wed, Mar 19, 2014 at 9:46 AM, Kevin B [blaisdellk@gmail.com](mailto:blaisdellk@gmail.com) wrote:

> The scenario I have is driving some index builds from an external  
> application. As part of this an analyzer would be chosen in the external  
> application. The intent here would be that a choice could be made from a  
> list of all analyzers available in the ES installation whether distributed  
> with ES or custom configured by someone on that particular installation.
> 
> To my surprise there doesn't seem to be a way via API to get a listing of  
> the available analyzers?
> 
> I do understand I can look at the source or the documentation to see the  
> default ones, but I am looking for a programatic, run time way to find what  
> is available. Am I missing something in the API or will I have to look at  
> creating a plugin to add this capability?
> 
> Kevin
> 
> --  
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/cd781459-16ec-4319-be29-52c3b9979e31%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/cd781459-16ec-4319-be29-52c3b9979e31%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/cd781459-16ec-4319-be29-52c3b9979e31%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/cd781459-16ec-4319-be29-52c3b9979e31%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQD7Dac80%3DggxCJPVrBjA1yf5XcGYydCtnBYuatr6hK7ug%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQD7Dac80%3DggxCJPVrBjA1yf5XcGYydCtnBYuatr6hK7ug%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![brian\_yoder](https://avatars.discourse-cdn.com/v4/letter/b/f1d935/32.png) [@brian\_yoder](https://discuss.elastic.co/u/brian_yoder)\
**Post date:** [March 19, 2014, 10:16pm UTC](https://discuss.elastic.co/t/listing-available-analyzers-via-api/16472/3 "2014-03-19T22:16:21Z")

</div>

Kevin.

Do you mean the index settings query API? For example, I issued the  
following query against my sgen (schema generation, an experimental index  
for exploring Elasticsearch mapping nooks and crannies):

$ curl -XGET '[http://localhost:9200/sgen/\_settings?pretty=true](http://localhost:9200/sgen/_settings?pretty=true)' && echo

And it gives me the following, which makes it easy (at least by looking at  
the JSON and my experience with parsing JSON) to deterministically list all  
of the custom analyzers that are defined:

{  
"sgen" : {  
"settings" : {  
"index" : {  
"uuid" : "ecznJNykSl-DguwyN6SIZg",  
"number\_of\_replicas" : "0",  
"analysis" : {  
"char\_filter" : {  
"finnish\_char\_mapper" : {  
"type" : "mapping",  
"mappings" : ["Å=\>O", "å=\>o", "W=\>V", "w=\>v"]  
}  
},  
"analyzer" : {  
"english\_standard\_analyzer" : {  
"type" : "custom",  
"filter" : ["standard", "lowercase", "asciifolding"],  
"tokenizer" : "standard"  
},  
"finnish\_stemming\_analyzer" : {  
"type" : "custom",  
"char\_filter" : ["finnish\_char\_mapper"],  
"filter" : [ "standard", "lowercase",  
"finnish\_snowball\_filter" ],  
"tokenizer" : "standard"  
},  
"english\_stemming\_analyzer" : {  
"type" : "custom",  
"filter" : [ "standard", "lowercase", "asciifolding",  
"english\_snowball\_filter" ],  
"tokenizer" : "standard"  
},  
"english\_stemming\_stop\_analyzer" : {  
"type" : "custom",  
"filter" : [ "standard", "lowercase", "asciifolding",  
"english\_stop\_filter", "english\_snowball\_filter" ],  
"tokenizer" : "standard"  
},  
"russian\_stemming\_analyzer" : {  
"type" : "custom",  
"filter" : [ "standard", "lowercase",  
"russian\_snowball\_filter" ],  
"tokenizer" : "standard"  
},  
"arabic\_stemming\_Arabic\_analyzer" : {  
"type" : "custom",  
"filter" : [ "standard", "lowercase",  
"Arabic\_stemming\_filter" ],  
"tokenizer" : "standard"  
}  
},  
"filter" : {  
"finnish\_snowball\_filter" : {  
"type" : "snowball",  
"language" : "Finnish"  
},  
"english\_stop\_filter" : {  
"type" : "stop",  
"language" : ["_english_"]  
},  
"english\_snowball\_filter" : {  
"type" : "snowball",  
"language" : "English"  
},  
"russian\_snowball\_filter" : {  
"type" : "snowball",  
"language" : "Russian"  
},  
"Arabic\_stemming\_filter" : {  
"type" : "stemmer",  
"name" : "Arabic"  
}  
}  
},  
"number\_of\_shards" : "1",  
"refresh\_interval" : "2s",  
"version" : {  
"created" : "1000099"  
}  
}  
}  
}  
}

Since in my case I never use a built-in analyzer, I don't need to query the  
field mappings to find them, nor do I need to depend on ES to dynamically  
detect the "correct" mapping (I turn all that stuff off). So the bottom  
line is: Disabling auto-index creation and auto-type mapping of new fields  
makes the system more robust, and has the wonderful side effect of making  
discovery of the schema easy and deterministic!

But for the available built-in analyzers, the Java side might be possible  
by listing the analyzer classes in the org.elasticsearch.index.analysispackage. It would involve a bit of Java reflection to automate this, but  
perhaps it could be done.

Hope this helps!

Brian

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/8f28a827-9627-4e6d-95af-d3ee78ca83c7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8f28a827-9627-4e6d-95af-d3ee78ca83c7%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:42am UTC](https://discuss.elastic.co/t/listing-available-analyzers-via-api/16472/4 "2017-07-06T01:42:02Z")

</div>


