# Exposing scoring factors upstream

**URL:** <https://discuss.elastic.co/t/exposing-scoring-factors-upstream/93628>\
**Category:** Elasticsearch\
**Created:** [July 18, 2017, 4:40pm UTC](https://discuss.elastic.co/t/exposing-scoring-factors-upstream/93628 "2017-07-18T16:40:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajeshdb](https://avatars.discourse-cdn.com/v4/letter/r/57b2e6/32.png) [@rajeshdb](https://discuss.elastic.co/u/rajeshdb)\
**Post date:** [July 18, 2017, 4:40pm UTC](https://discuss.elastic.co/t/exposing-scoring-factors-upstream/93628/1 "2017-07-18T16:40:58Z")

</div>

Hello,

I am trying to expose the factors used by Lucene in scoring upstream without using the explain functionality. Specifically, I wanted to expose the term frequency, the inverse document frequency and the matched token length in the case of a prefix query, by annotating each result with its corresponding factors. I looked at the Lucene SimilarityBase and Scorer classes, but they don't seem to allow adding anything to the result. The explain functionality seems expensive to do this.

Is this possible? If so, can someone provide pointers on this?

Thanks,  
Rajesh

---

<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:** [August 15, 2017, 4:41pm UTC](https://discuss.elastic.co/t/exposing-scoring-factors-upstream/93628/2 "2017-08-15T16:41:11Z")

</div>

Closed on August 15, 2017, 4:41pm UTC

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