# How to import attribute from another analyzer plugin

**URL:** <https://discuss.elastic.co/t/how-to-import-attribute-from-another-analyzer-plugin/241013>\
**Category:** Elasticsearch\
**Created:** [July 13, 2020, 4:32pm UTC](https://discuss.elastic.co/t/how-to-import-attribute-from-another-analyzer-plugin/241013 "2020-07-13T16:32:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JBo\_Shim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jbo_shim/32/47236_2.png) [@JBo\_Shim](https://discuss.elastic.co/u/JBo_Shim)\
**Post date:** [July 13, 2020, 4:32pm UTC](https://discuss.elastic.co/t/how-to-import-attribute-from-another-analyzer-plugin/241013/1 "2020-07-13T16:32:31Z")

</div>

Hi,  
I'm attempting to create custom token filter in elasticsearch (7.8.0, lucene 8.5.1).  
I managed to make my own plugin with filter, installed on my ES cluster.  
In this filter, I'm trying to use attribute from another analyzer plugin which is Nori and having a bit of trouble.

```auto
import org.apache.lucene.analysis.ko.tokenattributes.PartOfSpeechAttribute;
...
public class MyFilter extends TokenFilter {
    private final PartOfSpeechAttribute posAtt = addAttribute(PartOfSpeechAttribute.class);
...

```

This code gives me "java.lang.NoClassDefFoundError: org/apache/lucene/analysis/ko/tokenattributes/PartOfSpeechAttribute" when I try to add index with MyFilter settings.

I tried using fat jar (org.apache.lucene:lucene-analyzers-nori:8.5.1 included in MyFilter.jar) but same error occurred.

Any idea or piece of comment should help me greatly.  
Thanks in advance! 🙂

---

<div class="post-metadata">

**Author:** ![JBo\_Shim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jbo_shim/32/47236_2.png) [@JBo\_Shim](https://discuss.elastic.co/u/JBo_Shim)\
**Post date:** [July 15, 2020, 8:16am UTC](https://discuss.elastic.co/t/how-to-import-attribute-from-another-analyzer-plugin/241013/2 "2020-07-15T08:16:03Z")

</div>

I found solution and write here for anyone in need.

The only way to use PartOfSpeechAttribute.class set from nori-tokenizer is to add filter inside nori-analyzer so that nori-tokenizer and custom-filter is in same package & jar.

---

<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:** [August 12, 2020, 8:16am UTC](https://discuss.elastic.co/t/how-to-import-attribute-from-another-analyzer-plugin/241013/3 "2020-08-12T08:16:11Z")

</div>

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