# Adding a custom similarity plugin at index and cluster level in elasticsearch 2.3

**URL:** <https://discuss.elastic.co/t/adding-a-custom-similarity-plugin-at-index-and-cluster-level-in-elasticsearch-2-3/58986>\
**Category:** Elasticsearch\
**Created:** [August 25, 2016, 11:13pm UTC](https://discuss.elastic.co/t/adding-a-custom-similarity-plugin-at-index-and-cluster-level-in-elasticsearch-2-3/58986 "2016-08-25T23:13:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tdicken73](https://avatars.discourse-cdn.com/v4/letter/t/ba9def/32.png) [@tdicken73](https://discuss.elastic.co/u/tdicken73)\
**Post date:** [August 25, 2016, 11:13pm UTC](https://discuss.elastic.co/t/adding-a-custom-similarity-plugin-at-index-and-cluster-level-in-elasticsearch-2-3/58986/1 "2016-08-25T23:13:50Z")

</div>

I'm attempting to build my own similarity plugin and use it for the basis of scoring on an index. I have a built similarity plugin that I've dropped in my elasticsearch libs folder. I am adding it to the libs folder because when I tried to add it via the ES\_CLASSPATH, this error was given:

```
Error: Don't modify the classpath with ES_CLASSPATH. Best is to add
additional elements via the plugin mechanism, or if code must really be
added to the main classpath, add jars to lib/ (unsupported).

```

I restarted elasticsearch and attempted to create an index with this similarity plugin.

The reason I am seeing for the error is

`{"error":{"root_cause":[{"type":"remote_transport_exception","reason":"[Autolycus][127.0.0.1:9301][indices:admin/create]"}],"type":"illegal_argument_exception","reason":"Unknown Similarity type [testingsimilarity] for [custom_similarity]"}`

From all posts I have seen regarding this error, elasticsearch changed in 2.2 to not allow plugins to be deployed like this. So I also attempted to deploy it as the default similarity but the es node failed to start, due to  
`IllegalArgumentException[Unknown Similarity type [overlapsimilarity] for [default]];`

Is there another method to deploy custom similarity plugins, either at the cluster level or index level?

Thanks in advance

---

<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 5, 2017, 10:24pm UTC](https://discuss.elastic.co/t/adding-a-custom-similarity-plugin-at-index-and-cluster-level-in-elasticsearch-2-3/58986/2 "2017-07-05T22:24:44Z")

</div>


