# Custom token filter for Wordnet Hypernyms

**URL:** <https://discuss.elastic.co/t/custom-token-filter-for-wordnet-hypernyms/2018>\
**Category:** Elasticsearch\
**Created:** [June 5, 2015, 2:23pm UTC](https://discuss.elastic.co/t/custom-token-filter-for-wordnet-hypernyms/2018 "2015-06-05T14:23:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yaraju](https://avatars.discourse-cdn.com/v4/letter/y/cc9497/32.png) [@yaraju](https://discuss.elastic.co/u/yaraju)\
**Post date:** [June 5, 2015, 2:23pm UTC](https://discuss.elastic.co/t/custom-token-filter-for-wordnet-hypernyms/2018/1 "2015-06-05T14:23:46Z")

</div>

I'm writing a [custom token filter for using WordNet hypernyms](https://github.com/yaraju/elasticsearch-analysis-hypernym) instead of synonyms.

When I install the plugin and restart the server, I get the error that "hypernym requires `hypernyms_path` to be configured" which is obviously coming from [my token filter factory](https://github.com/yaraju/elasticsearch-analysis-hypernym/blob/master/src/main/java/org/elasticsearch/index/analysis/HypernymTokenFilterFactory.java).

However, I've not yet defined any index to use the filter - I've merely installed it. How do I make sure the custom token filter is only loaded when I configure "hypernym" as a token filter in an index setting? (Like, for example "synonyms" does)

I'd really appreciate a nudge in the right direction as this is my first ES plugin and my first custom filter.

---

<div class="post-metadata">

**Author:** ![yaraju](https://avatars.discourse-cdn.com/v4/letter/y/cc9497/32.png) [@yaraju](https://discuss.elastic.co/u/yaraju)\
**Post date:** [June 5, 2015, 4:33pm UTC](https://discuss.elastic.co/t/custom-token-filter-for-wordnet-hypernyms/2018/2 "2015-06-05T16:33:08Z")

</div>

I figured ths one out. I was missing an annotation on my TokenFilterFactory;

```
@AnalysisSettingsRequired

```

And now there's no error.

---

<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:** [July 6, 2017, 12:09am UTC](https://discuss.elastic.co/t/custom-token-filter-for-wordnet-hypernyms/2018/3 "2017-07-06T00:09:23Z")

</div>


