Date format high level rest client 6.2

record seems to be an object. Not a String.

BTW use .source(jsonString, XContentType.JSON) instead.