# How to Output Display the Document Scoring

**URL:** <https://discuss.elastic.co/t/how-to-output-display-the-document-scoring/347074>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [November 14, 2023, 3:43am UTC](https://discuss.elastic.co/t/how-to-output-display-the-document-scoring/347074 "2023-11-14T03:43:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![aisyaharifin](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@aisyaharifin](https://discuss.elastic.co/u/aisyaharifin)\
**Post date:** [November 14, 2023, 3:43am UTC](https://discuss.elastic.co/t/how-to-output-display-the-document-scoring/347074/1 "2023-11-14T03:43:53Z")

</div>

Hello Elastic,

I need help on how do we display the document scoring based on the search results?

For example like the Score on top of the Captain Marvel.

 ![Screenshot 2023-11-14 at 10.46.32 AM](https://us1.discourse-cdn.com/elastic/original/3X/3/1/317a293fabf8a9797d5c6f68f5385c7b6f793f27.png)

I've tried to explore the code but couldn't find on the specific scoring part.

> <https://github.com/elastic/elasticsearch-labs/tree/main/example-apps/relevance-workbench>
>
> //github.com/elastic/elasticsearch-labs/tree/main/example-apps/relevance-workbench

Appreciate your guidance thank you.

---

<div class="post-metadata">

**Author:** ![Sean\_Story](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sean_story/32/69987_2.png) [@Sean\_Story](https://discuss.elastic.co/u/Sean_Story)\
**Post date:** [November 14, 2023, 2:38pm UTC](https://discuss.elastic.co/t/how-to-output-display-the-document-scoring/347074/2 "2023-11-14T14:38:40Z")

</div>

@aisyaharifin I strongly suggest that you _not_ display the score values. These are not normalized, and don't have any concrete meaning - they are only relevant for a given instance of a given query, and only relevant to show relative ranking of results. We find that when folks start to pay attention to the values, they then start to be confused or frustrated when those values change from query to query, and therefore it's better to just display results sorted by score, but not display the actual score values.

---

<div class="post-metadata">

**Author:** ![aisyaharifin](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@aisyaharifin](https://discuss.elastic.co/u/aisyaharifin)\
**Post date:** [November 15, 2023, 12:28am UTC](https://discuss.elastic.co/t/how-to-output-display-the-document-scoring/347074/3 "2023-11-15T00:28:03Z")

</div>

> [@Sean\_Story](#):
>
> only relevant to show relative ranking of results.

Hi @Sean_Story, thank you for your reply, I see so the value is not normalized.

Well, this is because the requirement from the user is to show the ranking of the results so that they can choose which one is more accurate based on the query that they enter.

The requirement is the searching must be able to find the query attribute that has been enter to display (highlight attribute) result based on accuracy of total attribute found.

For example if they enter 4 different attribute query like "chicken,leg,bird,wing" top result will be **4/4 attribute found** followed by ¾ found or at least 60% accuracy.

You mentioned :

> therefore it's better to just display results sorted by score, but not display the actual score values.

How do we display results sorted by score?

Thank you for your assistance.

---

<div class="post-metadata">

**Author:** ![Sean\_Story](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sean_story/32/69987_2.png) [@Sean\_Story](https://discuss.elastic.co/u/Sean_Story)\
**Post date:** [November 15, 2023, 6:51pm UTC](https://discuss.elastic.co/t/how-to-output-display-the-document-scoring/347074/4 "2023-11-15T18:51:06Z")

</div>

> [@aisyaharifin](#):
>
> How do we display results sorted by score?

Elasticsearch's and App Search's default result ordering is sorted by score.

> For example if they enter 4 different attribute query like "chicken,leg,bird,wing" top result will be **4/4 attribute found** followed by ¾ found or at least 60% accuracy

This is how Elasticsearch and App Search relevance works, broadly. It becomes more complex if you use things like synonyms, so that `"chicken,leg,bird,wing"` matches a document like `"checken,leg,poultry,wing"`, or stemming which might match `"chickens,legs,birds,wings"`, or typo-tolerance, etc. If there are some concrete examples of queries that don't return the results in the order you're expecting, please share details and we can try to troubleshoot how to tune your relevance settings so that you get them ordered as expected.

---

<div class="post-metadata">

**Author:** ![aisyaharifin](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@aisyaharifin](https://discuss.elastic.co/u/aisyaharifin)\
**Post date:** [November 16, 2023, 3:48am UTC](https://discuss.elastic.co/t/how-to-output-display-the-document-scoring/347074/5 "2023-11-16T03:48:15Z")

</div>

> [@Sean\_Story](#):
>
> Elasticsearch's and App Search's default result ordering is sorted by score.

So how do I display the score? Is there a code reference for this?

---

<div class="post-metadata">

**Author:** ![Sean\_Story](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sean_story/32/69987_2.png) [@Sean\_Story](https://discuss.elastic.co/u/Sean_Story)\
**Post date:** [November 16, 2023, 4:30pm UTC](https://discuss.elastic.co/t/how-to-output-display-the-document-scoring/347074/6 "2023-11-16T16:30:23Z")

</div>

`score` is a field that should be present in the response object for each result. But again, I strongly recommend against displaying score, as the values have no intrinsic meaning, and their relative ordering is all that matters.

---

<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:** [December 14, 2023, 4:30pm UTC](https://discuss.elastic.co/t/how-to-output-display-the-document-scoring/347074/7 "2023-12-14T16:30:34Z")

</div>

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