Hi!
We have been using ES version 2.3.3 and a java process (using the BulkProcessor) on the same version on pre-prod to feed data to ES. However, we thought it would be best if we could migrate to 5.5.0 before going live, so we upgraded the libraries and installed a new ES instance with the brand new release.
I had to modify our connector (which fetches data from Oracle and converts it to java objects) to use PreBuiltTransportClient:
client = TransportClient.builder().settings(settings).build();
to
client = new PreBuiltTransportClient(settings);
Other than that there was no change on the connector code except for exception handling when calling Node.close(). The rest is exactly the same except for the new ES instance, which is an out of the box 5.5.0.
Once I started indexing documents to ES I saw errors on my log regarding date formatting:
message [MapperParsingException[failed to parse [ts_stop]]; nested: IllegalArgumentException[Invalid format: "2017-07-10 15:52:16.791" is malformed at " 15:52:16.791"]
The templates used for both instances are exactly the same, ts_stop (and other date fields) are defined as date type, with no format field. For debugging purposes I printed the documents right before adding them to the BulkProcessor and for both client versions the dates are printed with the same yyyy-MM-dd HH:mm:ss.SSS format. However, when looking at the JSON documents on the 2.3.3 ES version I can see that the dates are stored as yyyy-MM-ddTHH:mm:ss.SSSZ, which makes me think that either:
1 - BulkProcessor is formatting those dates before indexing them on ES 2.3.3 and on version 5.5.0 has changed its default behaviour and doesn't do that any more.
2 - ES is correctly processing those dates and reformatting them before indexing them on ES 2.3.3 (unlikely, as trying to PUT them with curl fails with the same error) and ES 5.5.0 has changed its default behaviour and cannot process that date format.
If I add my custom date formatting using the format field it works, but I would like to understand why this is happening and not take the "It's magic" explanation; whether it is a change on ES/client libraries from version 2.x.x to 5.x.x , a bug in ES 5.x, or if it isn't meant to work at all in ES 2.x and it was a "fortunate" bug of the old version. Could somebody shed some light on this, please?
Thank you very much for your help in advance,
Michael.