Precision in groovy scripts

Hello,

I'm having an issue handling big integers in script params. Can someone
please explain to me this behaviour:

Scenario a:
GET a/_search
{
"track_scores": true,
"fields": "_score",
"size": 1,
"query": {
"filtered": {
"query": {
"function_score": {
"score_mode": "sum",
"script_score": {
"script": "return a;",
"params": {
"a": 1414018800000,
"b": 1414627200000
}
}
}
}
}
}
}

Returns
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 10,
"max_score": 1414018760000,
"hits": [
{
"_index": "test",
"_type": "a",
"_id": "73",
"_score": 1414018760000
}
]
}
}

Returning "a" from the script score, the _score value is different from a: 1414018800000
!= 1414018760000

Scenario b:
GET a/_search
{
"track_scores": true,
"fields": "_score",
"size": 1,
"query": {
"filtered": {
"query": {
"function_score": {
"score_mode": "sum",
"script_score": {
"script": "return b;",
"params": {
"a": 1414018800000,
"b": 1414627200000
}
}
}
}
}
}
}

Returns
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 10,
"max_score": 1414627200000,
"hits": [
{
"_index": "search_test",
"_type": "property",
"_id": "73",
"_score": 1414627200000
}
]
}
}

Returning "b" from the script score, the _score value is equal to b 1414627200000
== 1414627200000

Is ES not able to tell the precision required for that number ?

Thanks,
Pedro

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/08ed79fa-93ec-4934-ac83-b04e3971d188%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.