1

We've seen a resurrection of this issue in a recent update of Elasticsearch (https://github.com/elastic/elasticsearch-net/issues/1937).

We set the SourceSerializer when creating the Client connection but that doesn't seem to help.

Debugging in, I see that RequestResponseSerializer defaults to Nest.InternalSerializer. This JSON serializer has the DateParseHandling field set to DateTime when we want DateTimeOffset. I suspect that this may be the cause of my problem.

Is there a way to set RequestResponseSerializer to verify my theory?


ADDITION: I was able to verify my theory above by altering the NEST code directly. I edited the InternalSerializer::CreateSettings() method to include DateParseHandling = DateParseHandling.DateTimeOffset and that solved the issue.

Now how to set/modify this value for RequestResponseSerializer without modifying NEST code directly...

Gerry
  • 11
  • 4
  • You can't set the `RequestResponseSerializer`. This serializer is used by NEST to ensure that all Request and Response types are serialized correctly. Could you update your question to explain what you are trying to achieve? – Russ Cam Oct 25 '18 at 23:56
  • Thanks Russ, the link in the question, referring to the Github issue, is exactly what I am trying to achieve. Basically, this was fixed but is now back (I assume, because of the serializer restructuring) – Gerry Oct 29 '18 at 15:59
  • In a nutshell, date is stored with TZ info (`{"startTimeLocal": "2016-03-21T09:45:20-02:00"}`), deserializing from ES is converting it to local system TZ. this results in lost TZ info from original data. Would just like to be able to set the RequestResponseSerializer to use `DateParseHandling = DateParseHandling.DateTimeOffset` rather than the current value `DateParseHandling.DateTime` – Gerry Oct 29 '18 at 16:05

1 Answers1

0

Turns out my issue was the same as https://github.com/elastic/elasticsearch-net/issues/3164 and seemed to be fixed in v6.2.0 (https://github.com/elastic/elasticsearch-net/pull/3278).

I was running v6.1.0

Upgraded my version to v6.3.1 and all looks well.

Gerry
  • 11
  • 4