Scroll timeout not taking in decimal for ES 5.4.1


(Divya Malini) #1

Hi,
We use the scroll api along with timeout option. Sample query like
GET my_index/my_type/_search?scroll=1.1m
{
"query": {
"match" : {
"content" : "a"
}
}
}

scroll=1.1m worked perfectly in ES2.4.1 but is throwing a parse exception in ES5.4.1 as below
"type": "parse_exception",
_ "reason": "failed to parse [1.1m], fractional time values are not supported"_

What is the reason for this change? Why are fraction values no more supported, could someone explain?

Thanks, Divya


(Thiago Souza) #2

Apparently the support for fractional time values was removed with this https://github.com/elastic/elasticsearch/pull/19102

It is unclear why, maybe @jasontedor can explain better.

But as a solution, couldn't you simply use an integer value in seconds?


(Jason Tedor) #3

Previously these time values were converted internally to nanoseconds, and at that point what the user entered would be lost (that is 1.1m and 66s would be represented the same internally). We switched to representing them in a format where we do not lose this information. We based this representation on Java TimeUnit. TimeUnit does not support fractional values. We felt that the simplicity of using a built-in for representing these time values was worth not supporting fractional values which:

  • are fraught with difficulties because of floating-point representations
  • do not offer any additional flexibility versus the user simply switching to another time unit (e.g., 1.5h can be changed to 90m).

(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.