# Installing an example plugin in elasticsearch

**URL:** <https://discuss.elastic.co/t/installing-an-example-plugin-in-elasticsearch/222913>\
**Category:** Elasticsearch\
**Created:** [March 10, 2020, 10:34am UTC](https://discuss.elastic.co/t/installing-an-example-plugin-in-elasticsearch/222913 "2020-03-10T10:34:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![divyanshumarwah](https://avatars.discourse-cdn.com/v4/letter/d/f08c70/32.png) [@divyanshumarwah](https://discuss.elastic.co/u/divyanshumarwah)\
**Post date:** [March 10, 2020, 10:34am UTC](https://discuss.elastic.co/t/installing-an-example-plugin-in-elasticsearch/222913/1 "2020-03-10T10:34:48Z")

</div>

Hi,

I am new to elasticsearch, and I want to develop an elasticsearch plugin for rescoring. I was looking through the web and found an example plugin in elasticsearch repository, Expert Scoring Script ([https://github.com/elastic/elasticsearch/tree/master/plugins/examples/script-expert-scoring](https://github.com/elastic/elasticsearch/tree/master/plugins/examples/script-expert-scoring)). But I am not sure how to install this plugin and use it in the search.  
Any help/suggestions would be greatly appreciated.

Regards  
Divyanshu

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [March 10, 2020, 1:17pm UTC](https://discuss.elastic.co/t/installing-an-example-plugin-in-elasticsearch/222913/2 "2020-03-10T13:17:14Z")

</div>

Hey,

you can clone the elasticsearch repository, change to the correct branch or tag of the version you want to build against, and then run

```auto
cd plugins/examples/script-expert-scoring
../../../gradlew assemble

```

This will leave you with a zip file that you can install via `elasticsearch-plugin`. If you write your own plugin, you separate this from elasticsearch however. This is an external example plugin [https://github.com/spinscale/elasticsearch-ingest-opennlp](https://github.com/spinscale/elasticsearch-ingest-opennlp)

--Alex

---

<div class="post-metadata">

**Author:** ![divyanshumarwah](https://avatars.discourse-cdn.com/v4/letter/d/f08c70/32.png) [@divyanshumarwah](https://discuss.elastic.co/u/divyanshumarwah)\
**Post date:** [March 19, 2020, 6:25am UTC](https://discuss.elastic.co/t/installing-an-example-plugin-in-elasticsearch/222913/3 "2020-03-19T06:25:17Z")

</div>

Hi Alex,

This worked fine for building and installing the plugin. Thanks for the help.  
But the "script-expert-scoring" plugin doesn't seem to work as expected. I am getting the result for postings as null:  
`PostingsEnum postings = context.reader().postings(new Term(field, term));`

while debugging this issue, I checked the value for `context.reader()`, it looked fine.  
also checked the value of `new Term(field,term)` and this is also fine.  
But the `postings(new Term(field,term)` is null.

Please can you suggest how to get this to work?

Regards  
Divyanshu

---

<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:** [April 16, 2020, 6:39am UTC](https://discuss.elastic.co/t/installing-an-example-plugin-in-elasticsearch/222913/4 "2020-04-16T06:39:44Z")

</div>

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