PLIGINS: How to get cluster/index settings from TokenFilterFactory


(FAGIM SADYKOV) #1

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);
}
?


(FAGIM SADYKOV) #2

Found it in AbstractTokenFilterFactory as indexSettings


(system) #3