[jira] [Commented] (SOLR-6562) Function query calculates the wrong value

2014-10-02 Thread JIRA

[ 
https://issues.apache.org/jira/browse/SOLR-6562?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14156446#comment-14156446
 ] 

Stefan Neumüller commented on SOLR-6562:


I found a way to add hours to a date without a too big precision loss. I use ms 
to subtract a negative date with the correct amount of hours. For example if 
I want to add 4 hours to mydate I write: ms(mydate,1969-12-31T20:00:00.000Z).

 Function query calculates the wrong value
 -

 Key: SOLR-6562
 URL: https://issues.apache.org/jira/browse/SOLR-6562
 Project: Solr
  Issue Type: Bug
Affects Versions: 4.9
Reporter: Stefan Neumüller
Priority: Critical

 This calculation 
 fl=sub(sum(abs(sub(1416906516710,141678360)),abs(sub(1036800,1416906516710))),10226321640)
  should return 0. But the calculated value is 8388608



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-6562) Function query calculates the wrong value

2014-09-30 Thread Hoss Man (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-6562?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14153532#comment-14153532
 ] 

Hoss Man commented on SOLR-6562:



This is currently working as designed -- not a bug, but i've opened some 
realted improvement issues i've had in the back of my mind and your report 
reminded me.

the ValueSource implementations (the internals of function queries) support 
math operations on diff data types (int, long, float, double, etc...) 
corrisponding to the lowest level FieldType support in lucene DocValues (the 
same API as used by the FieldCache).

However: at present, there is no general purpose way to indicate which datatype 
you'd like to see used when doing math operations (neither from a bottom up 
the source data is ints, so do int math or a top down i ultimately want a 
long, so do long math) standpoint.  

Since the primary purpose of function queries is to be used in boosting query 
scores, which are alreayd floating point -- that's what gets used at the moment.

bq. I'm using function queries to calculate dates. For example to add some 
hours to a date.

The ms() function is specifically designed to coerce millisecond based (long) 
math when subtraction on date fields like you are attempting in your original 
examples.  when combining the results of ms() inside of a sm() function that 
will still be done using floating point math by default however



 Function query calculates the wrong value
 -

 Key: SOLR-6562
 URL: https://issues.apache.org/jira/browse/SOLR-6562
 Project: Solr
  Issue Type: Bug
Affects Versions: 4.9
Reporter: Stefan Neumüller
Priority: Critical

 This calculation 
 fl=sub(sum(abs(sub(1416906516710,141678360)),abs(sub(1036800,1416906516710))),10226321640)
  should return 0. But the calculated value is 8388608



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-6562) Function query calculates the wrong value

2014-09-26 Thread JIRA

[ 
https://issues.apache.org/jira/browse/SOLR-6562?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14149021#comment-14149021
 ] 

Stefan Neumüller commented on SOLR-6562:


I'm using function queries to calculate dates. For example to add some hours to 
a date. And here I have problems with the precision. The result differs for 1-3 
minutes. It would be nice to allow solr to use double precision.

 Function query calculates the wrong value
 -

 Key: SOLR-6562
 URL: https://issues.apache.org/jira/browse/SOLR-6562
 Project: Solr
  Issue Type: Bug
Affects Versions: 4.9
Reporter: Stefan Neumüller
Priority: Critical

 This calculation 
 fl=sub(sum(abs(sub(1416906516710,141678360)),abs(sub(1036800,1416906516710))),10226321640)
  should return 0. But the calculated value is 8388608



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-6562) Function query calculates the wrong value

2014-09-25 Thread Xu Zhang (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-6562?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14148402#comment-14148402
 ] 

Xu Zhang commented on SOLR-6562:


This is floating number precision nature, when using float to represent big 
numbers, we will lose precision. Do we really need to support 
arbitrary-precision numbers ?


 Function query calculates the wrong value
 -

 Key: SOLR-6562
 URL: https://issues.apache.org/jira/browse/SOLR-6562
 Project: Solr
  Issue Type: Bug
Affects Versions: 4.9
Reporter: Stefan Neumüller
Priority: Critical

 This calculation 
 fl=sub(sum(abs(sub(1416906516710,141678360)),abs(sub(1036800,1416906516710))),10226321640)
  should return 0. But the calculated value is 8388608



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org