You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Daniel Shane (JIRA)" <ji...@apache.org> on 2015/05/27 16:38:17 UTC

[jira] [Created] (SOLR-7600) Many query functions will cast their operands in float and loose precision in the process.

Daniel Shane created SOLR-7600:
----------------------------------

             Summary: Many query functions will cast their operands in float and loose precision in the process.
                 Key: SOLR-7600
                 URL: https://issues.apache.org/jira/browse/SOLR-7600
             Project: Solr
          Issue Type: Bug
          Components: Server
    Affects Versions: 4.10.3
            Reporter: Daniel Shane
            Priority: Minor


Function Queries like the 'max' function will cast its result to a float value even if the source value cannot be converted to floating point without loosing precision.

For example, the max() function will convert dates to floats, and in the process we loose some precision (milliseconds). This is problematic if we want to sort afterwards since we do not have a millisecond precision anymore. I do not know if there is a work around short of creating a new set of query functions that would take longs / dates / etc... and return the corresponding type and name them 'long_max(), date_max() etc...'

I believe it would be more intuitive if functions like max() would return the same type as what they got in their argument (assuming they are all of the same type). 

max(date, date) should return a date
max(long, long) should return a long



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

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