You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by William Bell <bi...@gmail.com> on 2014/03/21 03:27:28 UTC

Rounding errors with SOLR score

When doing complex boosting/bq we are getting rounding errors on the score.

To get the score to be consistent I needed to use rint on sort:

sort=rint(product(sum($p_score,$s_score,$q_score),100)) desc,s_query asc

<str name="p_score">recip(priority,1,.5,.01)</str>
<str name="s_score">product(recip(synonym_rank,1,1,.01),17)</str>
<str name="q_score">
query({!dismax qf="user_query_edge^1 user_query^0.5 user_query_fuzzy"
v=$q1})
</str>

The issue is in the qf area.

{"s_query": "Ear Irrigation","score": 10.331313},{"s_query": "Ear Piercing",
"score": 10.331314},{"s_query": "Ear Pinning","score": 10.331313},

-- 
Bill Bell
billnbell@gmail.com
cell 720-256-8076

Re: Rounding errors with SOLR score

Posted by William Bell <bi...@gmail.com>.
I will send the debugQuery. They are exactly the same.



On Fri, Mar 21, 2014 at 2:59 AM, Raymond Wiker <rw...@gmail.com> wrote:

> Are you sure that SOLR is rounding incorrectly, and not simply differently
> from what you expect? I was surprised myself at some of the rounding
> behaviour I saw with SOLR, but according to
> http://en.wikipedia.org/wiki/Rounding , the results were valid (just not
> the round-up-from-half that I naively expected).
>
>
> On Fri, Mar 21, 2014 at 3:27 AM, William Bell <bi...@gmail.com> wrote:
>
> > When doing complex boosting/bq we are getting rounding errors on the
> score.
> >
> > To get the score to be consistent I needed to use rint on sort:
> >
> > sort=rint(product(sum($p_score,$s_score,$q_score),100)) desc,s_query asc
> >
> > <str name="p_score">recip(priority,1,.5,.01)</str>
> > <str name="s_score">product(recip(synonym_rank,1,1,.01),17)</str>
> > <str name="q_score">
> > query({!dismax qf="user_query_edge^1 user_query^0.5 user_query_fuzzy"
> > v=$q1})
> > </str>
> >
> > The issue is in the qf area.
> >
> > {"s_query": "Ear Irrigation","score": 10.331313},{"s_query": "Ear
> > Piercing",
> > "score": 10.331314},{"s_query": "Ear Pinning","score": 10.331313},
> >
> > --
> > Bill Bell
> > billnbell@gmail.com
> > cell 720-256-8076
> >
>



-- 
Bill Bell
billnbell@gmail.com
cell 720-256-8076

Re: Rounding errors with SOLR score

Posted by Raymond Wiker <rw...@gmail.com>.
Are you sure that SOLR is rounding incorrectly, and not simply differently
from what you expect? I was surprised myself at some of the rounding
behaviour I saw with SOLR, but according to
http://en.wikipedia.org/wiki/Rounding , the results were valid (just not
the round-up-from-half that I naively expected).


On Fri, Mar 21, 2014 at 3:27 AM, William Bell <bi...@gmail.com> wrote:

> When doing complex boosting/bq we are getting rounding errors on the score.
>
> To get the score to be consistent I needed to use rint on sort:
>
> sort=rint(product(sum($p_score,$s_score,$q_score),100)) desc,s_query asc
>
> <str name="p_score">recip(priority,1,.5,.01)</str>
> <str name="s_score">product(recip(synonym_rank,1,1,.01),17)</str>
> <str name="q_score">
> query({!dismax qf="user_query_edge^1 user_query^0.5 user_query_fuzzy"
> v=$q1})
> </str>
>
> The issue is in the qf area.
>
> {"s_query": "Ear Irrigation","score": 10.331313},{"s_query": "Ear
> Piercing",
> "score": 10.331314},{"s_query": "Ear Pinning","score": 10.331313},
>
> --
> Bill Bell
> billnbell@gmail.com
> cell 720-256-8076
>