# Can't get Type in Custom Plugin

**URL:** <https://discuss.elastic.co/t/cant-get-type-in-custom-plugin/143805>\
**Category:** Elasticsearch\
**Created:** [August 10, 2018, 6:29am UTC](https://discuss.elastic.co/t/cant-get-type-in-custom-plugin/143805 "2018-08-10T06:29:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![trantrungtruc05](https://avatars.discourse-cdn.com/v4/letter/t/edb3f5/32.png) [@trantrungtruc05](https://discuss.elastic.co/u/trantrungtruc05)\
**Post date:** [August 10, 2018, 6:29am UTC](https://discuss.elastic.co/t/cant-get-type-in-custom-plugin/143805/1 "2018-08-10T06:29:47Z")

</div>

I have writing plugin by Java Code below:

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

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [August 10, 2018, 7:16am UTC](https://discuss.elastic.co/t/cant-get-type-in-custom-plugin/143805/2 "2018-08-10T07:16:16Z")

</div>

Please format your code, logs or configuration files using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) 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:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/e/7e6e239431ec2d71cbf1beef741f2e93e7cc762c.jpg)

Could you share your elasticsearch logs?

---

<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:** [September 7, 2018, 7:16am UTC](https://discuss.elastic.co/t/cant-get-type-in-custom-plugin/143805/3 "2018-09-07T07:16:21Z")

</div>

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