I currently have an elasticsearch query through NEST that is retrieving an object such as
public class ElasticSearchObject
{
[PropertyName("code")]
public string Code { get; set; }
[PropertyName("geometria")]
public MultiPolygonGeoShape Geometria { get; set; }
}
The query right now is working, but I need to change the type for "Geometria" property (which is mapped to a geo_shape field in the elasticseach stored document). Now it has to be a string holding a GeoJSON string. I could post-process the MultiPolygonGeoShape property and build the GeoJSON string from its content, but I wonder... Is it there a more direct approach?
As far as I know the geo_shape field is already stored in the elasticsearch JSON document as a GeoJSON string, so it looks to me like a waste of resources going through reading the geo_shape fromt the JSON document, deserializing into MultiPolygonGeoShape and then postprocessing to GeoJSON, when the GeoJSON was already there from the beginning.