# Plug-in Java or Python or Scala function to re-calculate document score?

**URL:** <https://discuss.elastic.co/t/plug-in-java-or-python-or-scala-function-to-re-calculate-document-score/25545>\
**Category:** Elasticsearch\
**Created:** [July 14, 2015, 6:31pm UTC](https://discuss.elastic.co/t/plug-in-java-or-python-or-scala-function-to-re-calculate-document-score/25545 "2015-07-14T18:31:57Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![linlma](https://avatars.discourse-cdn.com/v4/letter/l/ec9cab/32.png) [@linlma](https://discuss.elastic.co/u/linlma)\
**Post date:** [July 14, 2015, 8:03pm UTC](https://discuss.elastic.co/t/plug-in-java-or-python-or-scala-function-to-re-calculate-document-score/25545/3 "2015-07-14T20:03:31Z")

</div>

Thanks Nik,

Is there a guide how to write a sample native script and deploy into Elasticsearch's class path, and leverage it during query?

BTW, I have another question on customized scoring, and if you could comment, it will be great,

> [@Calculate top common fields for matched documents](https://discuss.elastic.co/t/calculate-top-common-fields-for-matched-documents/25546):
>
> Hello Elastic Search experts, I want to calculate top common fields, and their values for matched documents for a query, other than return the matched document itself. I want to calculate top common fields by a customized function (could be implemented by Java/Python or Scala). The question is, is it possible to plug-in the customized function inside ElasticSearch cluster? Which has the benefit of saving bandwidth to transfer all documents back (which is huge number), v.s. only return top comm…

regards,  
Lin

---

_[View the full topic](https://discuss.elastic.co/t/plug-in-java-or-python-or-scala-function-to-re-calculate-document-score/25545)._
