From 44f47289beafde80201d63dea8df8d4d288130bf Mon Sep 17 00:00:00 2001 From: Stuart Cam Date: Thu, 15 Aug 2019 13:39:06 +1000 Subject: [PATCH] Ensure GeoLocationFormatter returns GeoLocation type (#4026) The ReindexApiTests were failing on a serialisation roundtrip when dealing with properties that used the GeoLocation type. This manifested due to the inclusion of GeoLocation types in the _source serialisation on commit https://github.com/elastic/elasticsearch-net/commit/5492599e7d5964bbc0c9f7975f81ad5db276ea4e The GeoLocationFormatter was found to be returning a GeoCoordinate type and not a GeoLocation type. --- src/Nest/QueryDsl/Geo/GeoLocationFormatter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Nest/QueryDsl/Geo/GeoLocationFormatter.cs b/src/Nest/QueryDsl/Geo/GeoLocationFormatter.cs index c31710afdda..23d19b97b3e 100644 --- a/src/Nest/QueryDsl/Geo/GeoLocationFormatter.cs +++ b/src/Nest/QueryDsl/Geo/GeoLocationFormatter.cs @@ -42,7 +42,7 @@ public GeoLocation Deserialize(ref JsonReader reader, IJsonFormatterResolver for reader.ReadNextBlock(); } - return new GeoCoordinate(lat, lon); + return new GeoLocation(lat, lon); } public void Serialize(ref JsonWriter writer, GeoLocation value, IJsonFormatterResolver formatterResolver)