I the settings of my index I have this field:
"publishedDate": {
"type": "date",
"format": "yyyy-MM-dd'T'HH:mm:ssZ",
"store": true
}
And in a query I use that field in a Decay function like:
"gauss" : {
"someField" : {
"origin" : 1455710259655,
"scale" : "200dd",
"decay" : 0.2
}
}
But I get the exception:
java.lang.IllegalArgumentException: Invalid format: "1455710259655" is malformed at "9655"
I tried to reproduce this error using joda
which handles Date conversions in Elasticsearch:
Long currentMs = new DateTime().getMillis());
DateTimeFormatter currentMsTimeFormat = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ssZ");
DateTime dt = currentMsTimeFormat.parseDateTime(String.valueOf(currentMs));
System.out.println(dt.toString());
This snippet also raises the same exception if currentMs
is 1455710259655
.
I am using ES 2.1.1.
How to solve this issue?