Can't get Type in Custom Plugin


(Trực Trần Trung) #1

I have writing plugin by Java Code below:

public class BasicPlugin extends Plugin implements AnalysisPlugin {
    private final static Logger LOGGER = LogManager.getLogger(BasicPlugin.class);

    public BasicPlugin() {
        super();
        LOGGER.warn("Create the Basic Plugin and installed it into elasticsearch");
    }

    @Override
    public Map<String, AnalysisModule.AnalysisProvider<TokenFilterFactory>> getTokenFilters() {
        return Collections.singletonMap("jettro", KeywordRepeatFilterFactory::new);
    }

}

I built and install elasticsearch success but when I test in kibana it not detect type . Example below

Request:

PUT test01
{
"settings": {
"analysis": {
"analyzer": {
"autocomplete": {
"tokenizer": "standard",
"filter": [
"lowercase",
"test"
]
}
},
"filter": {
"test": {
"type": "jettro"
}
}

}

}
}

Response:

{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "Unknown tokenfilter type [jettro] for [unique_stem]"
}
],
"type": "illegal_argument_exception",
"reason": "Unknown tokenfilter type [jettro] for [unique_stem]"
},
"status": 400
}

Everyone can help me ? Thanks !!!


(David Pilato) #2

Please format your code, logs or configuration files using </> icon as explained in this guide and not the citation button. It will make your post more readable.

Or use markdown style like:

```
CODE
```

This is the icon to use if you are not using markdown format:

Could you share your elasticsearch logs?


(system) closed #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.