# Elasticsearch scoring plugin with access to another document

**URL:** <https://discuss.elastic.co/t/elasticsearch-scoring-plugin-with-access-to-another-document/97790>\
**Category:** Elasticsearch\
**Created:** [August 21, 2017, 3:30pm UTC](https://discuss.elastic.co/t/elasticsearch-scoring-plugin-with-access-to-another-document/97790 "2017-08-21T15:30:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mlbenjii](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@mlbenjii](https://discuss.elastic.co/u/mlbenjii)\
**Post date:** [August 21, 2017, 3:30pm UTC](https://discuss.elastic.co/t/elasticsearch-scoring-plugin-with-access-to-another-document/97790/1 "2017-08-21T15:30:26Z")

</div>

Hello,

I am attempting to write a native plugin that scores documents relative to properties of a given document, call it X.

A naive approach is to pass the properties of X to the plugin as parameters, but this exposes the inner workings of the scoring.

Ideally, the ID of X could be passed to the script, which could lookup the necessary properties and compute the score. I don't see any way to access X from a script... is this possible?

Thanks!

---

<div class="post-metadata">

**Author:** ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)\
**Post date:** [August 21, 2017, 7:05pm UTC](https://discuss.elastic.co/t/elasticsearch-scoring-plugin-with-access-to-another-document/97790/2 "2017-08-21T19:05:56Z")

</div>

Scoring is meant to access a single document at a time, in docid order. You can't jump to another document.

---

<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:** [September 18, 2017, 7:06pm UTC](https://discuss.elastic.co/t/elasticsearch-scoring-plugin-with-access-to-another-document/97790/3 "2017-09-18T19:06:14Z")

</div>

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