Invalid epoch_millis for Java client when adding document with Date.getTime()


(David Pocivalnik) #1

I have the following mapping defined:

"stopDate": { 
            "type": "date", "index": true, "store": false,
            "format": "yyyy-MM-dd HH:mm:ss:SSS||yyyy-MM-dd HH:mm:ss||epoch_millis"
        }

and with Java I just get someDate.getTime() where I get a long back.

The error I get during indexing is:

  [MapperParsingException[failed to parse [stopDate]]; nested: IllegalArgumentException[Invalid format:
 "1505201004403" is malformed at "4403"];]

So my question is, what format do I need? I found some issue here: https://github.com/elastic/elasticsearch/issues/18507 , but can't make anything out of it. Obviously there's still a check, but the value I put in (according to the exception) is only 13 characters long.

So, what do I have to do? or do I need to specify the format differently?

Thanks for any hints.


(system) #2

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