# PLIGINS: How to get cluster/index settings from TokenFilterFactory

**URL:** https://discuss.elastic.co/t/pligins-how-to-get-cluster-index-settings-from-tokenfilterfactory/416
**Category:** Elasticsearch
**Created:** [May 8, 2015, 6:41pm UTC](https://discuss.elastic.co/t/pligins-how-to-get-cluster-index-settings-from-tokenfilterfactory/416 "2015-05-08T18:41:59Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![comdiv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/comdiv/32/44902_2.png) [@comdiv](https://discuss.elastic.co/u/comdiv)
#### Post date: [May 8, 2015, 6:41pm UTC](https://discuss.elastic.co/t/pligins-how-to-get-cluster-index-settings-from-tokenfilterfactory/416/1 "2015-05-08T18:41:59Z")

</div>

Is it possible to provide some data to factory from /\_settings or /[index]/\_settings

My tokenfilter has an option that setup flag value to use as ignore-marker for  
tokens if specified with FlagsAttribute.  
While it's not standatized and can cause conflicts i want provide cluster/index wide option for it:  
PUT /\_settings  
{  
"myfilter\_ignore\_flag" : 64  
}

So i want to allow TokenFilterFactory somehow access this settings.

For example in PLUGIN entry point  
@Override  
public Collection\<Class\<? extends Module\>\> modules() {  
return ImmutableList.\<Class\<? extends Module\>\>of(MYMODULE.class);  
}

```
public void onModule(AnalysisModule module) {
    module.addProcessor(new MYBINDER()); 
}

```

Entry in MYMODULE.class  
public MYMODULE(Settings settings,  
IndicesAnalysisService indicesAnalysisService) {  
super(settings);  
....

Settings is not what i'm looking for.

How can I acess cluster settings in plugin loading phase?  
If it's not available can I get them in factory  
@Override  
public TokenStream create(TokenStream tokenStream) {  
return new MYFILTER(tokenStream);  
}  
?

---

<div class="post-metadata">

### Author: ![comdiv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/comdiv/32/44902_2.png) [@comdiv](https://discuss.elastic.co/u/comdiv)
#### Post date: [May 10, 2015, 12:48pm UTC](https://discuss.elastic.co/t/pligins-how-to-get-cluster-index-settings-from-tokenfilterfactory/416/2 "2015-05-10T12:48:32Z")

</div>

Found it in AbstractTokenFilterFactory as indexSettings

---

<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, 12:14am UTC](https://discuss.elastic.co/t/pligins-how-to-get-cluster-index-settings-from-tokenfilterfactory/416/3 "2017-07-06T00:14:46Z")

</div>


