Re: Rounding errors with SOLR score
I will send the debugQuery. They are exactly the same. On Fri, Mar 21, 2014 at 2:59 AM, Raymond Wiker rwi...@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 billnb...@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_scorerecip(priority,1,.5,.01)/str str name=s_scoreproduct(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 billnb...@gmail.com cell 720-256-8076 -- Bill Bell billnb...@gmail.com cell 720-256-8076
Re: Rounding errors with SOLR score
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 billnb...@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_scorerecip(priority,1,.5,.01)/str str name=s_scoreproduct(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 billnb...@gmail.com cell 720-256-8076
Re: Rounding errors in solr
Is this possible to do? If so, how? On 7/25/11, Brian Lamb brian.l...@journalexperts.com wrote: Yes and that's causing some problems in my application. Is there a way to truncate the 7th decimal place in regards to sorting by the score? On Fri, Jul 22, 2011 at 4:27 PM, Yonik Seeley yo...@lucidimagination.comwrote: On Fri, Jul 22, 2011 at 4:11 PM, Brian Lamb brian.l...@journalexperts.com wrote: I've noticed some peculiar scoring issues going on in my application. For example, I have a field that is multivalued and has several records that have the same value. For example, arr name=references strNational Society of Animal Lovers/str strNat. Soc. of Ani. Lov./str /arr I have about 300 records with that exact value. Now, when I do a search for references:(national society animal lovers), I get the following results: id252/id id159/id id82/id id452/id id105/id When I do a search for references:(nat soc ani lov), I get the results ordered differently: id510/id id122/id id501/id id82/id id252/id When I load all the records that match, I notice that at some point, the scores aren't the same but differ by only a little: 1.471928 in one and the one before it was 1.471929 32 bit floats only have 7 decimal digits of precision, and in floating point land (a+b+c) can be slightly different than (c+b+a) -Yonik http://www.lucidimagination.com
Re: Rounding errors in solr
On Mon, Jul 25, 2011 at 10:12 AM, Brian Lamb brian.l...@journalexperts.com wrote: Yes and that's causing some problems in my application. Is there a way to truncate the 7th decimal place in regards to sorting by the score? Not built in. With some Java coding, you could create a post filter that manipulates scores. http://wiki.apache.org/solr/CommonQueryParameters#Caching_of_filters -Yonik http://www.lucidimagination.com On Fri, Jul 22, 2011 at 4:27 PM, Yonik Seeley yo...@lucidimagination.com wrote: On Fri, Jul 22, 2011 at 4:11 PM, Brian Lamb brian.l...@journalexperts.com wrote: I've noticed some peculiar scoring issues going on in my application. For example, I have a field that is multivalued and has several records that have the same value. For example, arr name=references strNational Society of Animal Lovers/str strNat. Soc. of Ani. Lov./str /arr I have about 300 records with that exact value. Now, when I do a search for references:(national society animal lovers), I get the following results: id252/id id159/id id82/id id452/id id105/id When I do a search for references:(nat soc ani lov), I get the results ordered differently: id510/id id122/id id501/id id82/id id252/id When I load all the records that match, I notice that at some point, the scores aren't the same but differ by only a little: 1.471928 in one and the one before it was 1.471929 32 bit floats only have 7 decimal digits of precision, and in floating point land (a+b+c) can be slightly different than (c+b+a) -Yonik http://www.lucidimagination.com
Re: Rounding errors in solr
Yes and that's causing some problems in my application. Is there a way to truncate the 7th decimal place in regards to sorting by the score? On Fri, Jul 22, 2011 at 4:27 PM, Yonik Seeley yo...@lucidimagination.comwrote: On Fri, Jul 22, 2011 at 4:11 PM, Brian Lamb brian.l...@journalexperts.com wrote: I've noticed some peculiar scoring issues going on in my application. For example, I have a field that is multivalued and has several records that have the same value. For example, arr name=references strNational Society of Animal Lovers/str strNat. Soc. of Ani. Lov./str /arr I have about 300 records with that exact value. Now, when I do a search for references:(national society animal lovers), I get the following results: id252/id id159/id id82/id id452/id id105/id When I do a search for references:(nat soc ani lov), I get the results ordered differently: id510/id id122/id id501/id id82/id id252/id When I load all the records that match, I notice that at some point, the scores aren't the same but differ by only a little: 1.471928 in one and the one before it was 1.471929 32 bit floats only have 7 decimal digits of precision, and in floating point land (a+b+c) can be slightly different than (c+b+a) -Yonik http://www.lucidimagination.com
Re: Rounding errors in solr
On Fri, Jul 22, 2011 at 4:11 PM, Brian Lamb brian.l...@journalexperts.com wrote: I've noticed some peculiar scoring issues going on in my application. For example, I have a field that is multivalued and has several records that have the same value. For example, arr name=references strNational Society of Animal Lovers/str strNat. Soc. of Ani. Lov./str /arr I have about 300 records with that exact value. Now, when I do a search for references:(national society animal lovers), I get the following results: id252/id id159/id id82/id id452/id id105/id When I do a search for references:(nat soc ani lov), I get the results ordered differently: id510/id id122/id id501/id id82/id id252/id When I load all the records that match, I notice that at some point, the scores aren't the same but differ by only a little: 1.471928 in one and the one before it was 1.471929 32 bit floats only have 7 decimal digits of precision, and in floating point land (a+b+c) can be slightly different than (c+b+a) -Yonik http://www.lucidimagination.com