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 !!!