# How to get currently used analyzer?

**URL:** <https://discuss.elastic.co/t/how-to-get-currently-used-analyzer/6398>\
**Category:** Elasticsearch\
**Created:** [January 16, 2012, 12:36pm UTC](https://discuss.elastic.co/t/how-to-get-currently-used-analyzer/6398 "2012-01-16T12:36:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam\_4](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@Sam\_4](https://discuss.elastic.co/u/Sam_4)\
**Post date:** [January 16, 2012, 12:36pm UTC](https://discuss.elastic.co/t/how-to-get-currently-used-analyzer/6398/1 "2012-01-16T12:36:45Z")

</div>

Hi

Is there is any java classes that help to get the name of analyzer  
which is currently used.by default it use the default analyzer,if try  
to explicitly define custom analyzer,there is any way i can make sure  
which analyzer being used.

Thanks

---

<div class="post-metadata">

**Author:** ![Sam\_4](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@Sam\_4](https://discuss.elastic.co/u/Sam_4)\
**Post date:** [January 17, 2012, 7:13am UTC](https://discuss.elastic.co/t/how-to-get-currently-used-analyzer/6398/2 "2012-01-17T07:13:54Z")

</div>

```
            Index index = new Index(indexName);               

```

AnalysisService analysisService = new AnalysisService(index);  
NamedAnalyzer defaultIndexAnalyzer =  
analysisService.defaultIndexAnalyzer();  
System.out.println("default index  
analyzer::"+defaultIndexAnalyzer.name());  
NamedAnalyzer defaultSearchAnalyzer =  
analysisService.defaultSearchAnalyzer();  
System.out.println("default search  
analyzer::"+defaultSearchAnalyzer.name());

On Jan 16, 5:36 pm, sam [mishra.sam...@gmail.com](mailto:mishra.sam...@gmail.com) wrote:

> Hi
> 
> Is there is any java classes that help to get the name of analyzer  
> which is currently used.by default it use the default analyzer,if try  
> to explicitly define custom analyzer,there is any way i can make sure  
> which analyzer being used.
> 
> Thanks

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [January 17, 2012, 9:58am UTC](https://discuss.elastic.co/t/how-to-get-currently-used-analyzer/6398/3 "2012-01-17T09:58:37Z")

</div>

You can use get settings API for an index, if you explicitly specified it.  
If not, its the standard analyzer.

On Mon, Jan 16, 2012 at 2:36 PM, sam [mishra.sameek@gmail.com](mailto:mishra.sameek@gmail.com) wrote:

> Hi
> 
> Is there is any java classes that help to get the name of analyzer  
> which is currently used.by default it use the default analyzer,if try  
> to explicitly define custom analyzer,there is any way i can make sure  
> which analyzer being used.
> 
> Thanks

---

<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, 3:42am UTC](https://discuss.elastic.co/t/how-to-get-currently-used-analyzer/6398/4 "2017-07-06T03:42:30Z")

</div>


