Scores are Java floats so I'd expect them to be less precise then the long that getTime returns. I believe you could look at sorting rather then scoring or look at reducing the precision on the top bits of your long. You know, y2k bug style.
The reason the score is a float is that for text scoring its exact enough. Also, some of the lucene data structures are actually more lossy then float. The field norm, iirc, is a floating point number packet into 8 bits rather the float's 32. Nik On Wed, Apr 30, 2014 at 5:56 AM, Loïc Wenkin <[email protected]> wrote: > Hello everybody, > > I am using the function_score query in order to compute a custom score for > items I am indexing into ElasticSearch. I am using a native script (written > in Java) in order to compute my score. This score is computed based on a > date (Date.getTime()). When I use a logger and look what is returned by my > native script, I get what I want, but when I look at the score of items > returned by query (I use the replace mode), I get a truncated number (e.g. > if a computed score displayed in the native script with the value 1 392 028 > 423 243, it is returned with the value 1 392 028 420 000 as score of > returned items). The problem here is that I am loosing milliseconds and > seconds (I only get the decade part of seconds). Loose milliseconds can be > acceptable, but I can't loose seconds. > > Is this problem a limitation of ElasticSearch ? Is there any way to > workaround this problem ? > > Thanks in advance for your replies. > > Regards, > Loïc Wenkin > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/elasticsearch/ccf7c19e-aa70-42ac-a4a4-d7174ab0de49%40googlegroups.com<https://groups.google.com/d/msgid/elasticsearch/ccf7c19e-aa70-42ac-a4a4-d7174ab0de49%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAPmjWd39xkFEJNfb0x8C-M5h6GaxP7qqFYBFjTcBua1siVRttQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
