# Relevance in the range 0.0 to 1.0?

**URL:** <https://discuss.elastic.co/t/relevance-in-the-range-0-0-to-1-0/20587>\
**Category:** Elasticsearch\
**Created:** [November 5, 2014, 7:42pm UTC](https://discuss.elastic.co/t/relevance-in-the-range-0-0-to-1-0/20587 "2014-11-05T19:42:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dustin\_Boswell](https://avatars.discourse-cdn.com/v4/letter/d/839c29/32.png) [@Dustin\_Boswell](https://discuss.elastic.co/u/Dustin_Boswell)\
**Post date:** [November 5, 2014, 7:42pm UTC](https://discuss.elastic.co/t/relevance-in-the-range-0-0-to-1-0/20587/1 "2014-11-05T19:42:59Z")

</div>

Is there a way to score documents so that the relevance score has a fixed  
range, like from 0 to 1.0 ? The default scoring can return arbitrarily high  
scores, depending on how many times the matching term appears in the  
document.

It's tempting to want to normalize the score by the top-matching document,  
but this is wrong since the top document isn't always a perfect match.

Are there other built-in scorers, or parameter settings that will do this?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/dbf1f137-b160-4e30-94b7-1cc9b8fb939e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/dbf1f137-b160-4e30-94b7-1cc9b8fb939e%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![simonw\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonw_2/32/1130_2.png) [@simonw\_2](https://discuss.elastic.co/u/simonw_2)\
**Post date:** [November 6, 2014, 7:11pm UTC](https://discuss.elastic.co/t/relevance-in-the-range-0-0-to-1-0/20587/2 "2014-11-06T19:11:23Z")

</div>

I think you should read  
this [Log In - Apache Software Foundation](https://wiki.apache.org/lucene-java/ScoresAsPercentages)

it might help you to make a point.

simon

On Wednesday, November 5, 2014 8:42:59 PM UTC+1, Dustin Boswell wrote:

> Is there a way to score documents so that the relevance score has a fixed  
> range, like from 0 to 1.0 ? The default scoring can return arbitrarily high  
> scores, depending on how many times the matching term appears in the  
> document.
> 
> It's tempting to want to normalize the score by the top-matching document,  
> but this is wrong since the top document isn't always a perfect match.
> 
> Are there other built-in scorers, or parameter settings that will do this?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/6dc24bd4-f96b-46ca-8679-88846bf60064%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6dc24bd4-f96b-46ca-8679-88846bf60064%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Dustin\_Boswell](https://avatars.discourse-cdn.com/v4/letter/d/839c29/32.png) [@Dustin\_Boswell](https://discuss.elastic.co/u/Dustin_Boswell)\
**Post date:** [November 7, 2014, 12:55am UTC](https://discuss.elastic.co/t/relevance-in-the-range-0-0-to-1-0/20587/3 "2014-11-07T00:55:25Z")

</div>

Glad to know lots of other people have been asking for it too 🙂

I agree that dividing the default relevance score by some constant (or some  
number derived from the results) is a bad idea, for all the reasons that  
article describes.

I was hoping there was a non-default scorer that is built to return 0-1.0  
scores by design. At my company we have a home-grown search engine that  
returns relevance scores in this range, and it works great. (Maybe I could  
discuss the algorithm further with the team offline, it's pretty good.)  
We're looking to use elasticsearch for some of our applications, and this  
feature would help.

I guess I could go down the road of writing a custom scoring algorithm (in  
Java?) but not sure how much of an undertaking that is...

On Thursday, November 6, 2014 11:11:23 AM UTC-8, simonw wrote:

> I think you should read this  
> [Log In - Apache Software Foundation](https://wiki.apache.org/lucene-java/ScoresAsPercentages)
> 
> it might help you to make a point.
> 
> simon
> 
> On Wednesday, November 5, 2014 8:42:59 PM UTC+1, Dustin Boswell wrote:
> 
> > Is there a way to score documents so that the relevance score has a fixed  
> > range, like from 0 to 1.0 ? The default scoring can return arbitrarily high  
> > scores, depending on how many times the matching term appears in the  
> > document.
> > 
> > It's tempting to want to normalize the score by the top-matching  
> > document, but this is wrong since the top document isn't always a perfect  
> > match.
> > 
> > Are there other built-in scorers, or parameter settings that will do this?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/6c2507f3-a02d-4691-bb6c-0b027bd4e7e2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6c2507f3-a02d-4691-bb6c-0b027bd4e7e2%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 12:51am UTC](https://discuss.elastic.co/t/relevance-in-the-range-0-0-to-1-0/20587/4 "2017-07-06T00:51:36Z")

</div>


