Skip to content

Commit 8824148

Browse files
committed
GeoJson type output from the processor is now CamelCase again
1 parent 9ae07a2 commit 8824148

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/main/java/org/opendatasoft/elasticsearch/ingest/GeoExtensionProcessor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.opendatasoft.elasticsearch.ingest;
22

33
import org.apache.lucene.util.BytesRef;
4+
import org.elasticsearch.common.geo.GeoJson;
45
import org.elasticsearch.common.geo.GeoPoint;
56
import org.elasticsearch.common.geo.GeometryNormalizer;
67
import org.elasticsearch.common.geo.GeometryParser;
@@ -141,7 +142,7 @@ public IngestDocument execute(IngestDocument ingestDocument) throws IOException,
141142
ingestDocument.setFieldValue(geoShapeField + "." + fixedField, altWKT);
142143
}
143144

144-
String geomType = fixedGeom.type().toString();
145+
String geomType = GeoJson.getGeoJsonName(fixedGeom);
145146

146147
// compute and add extra geo sub-fields
147148
// NOTE: elasticsearch.common.geo encodes with Little-Endianess.

src/yamlRestTest/resources/rest-api-spec/test/GeoExtension/20_geo_ingest_processor.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@
138138

139139
- match: {hits.hits.0._source.geo_shape_0.fixed_shape: "POLYGON ((2.021484375 48.596592251456705, 3.262939453125 48.922499263758255, 2.779541015625 49.196064000723794, 2.0654296875 49.23194729854559, 1.6809082031249998 49.05227025601607, 2.021484375 48.596592251456705))" }
140140

141+
# Test the shape type
142+
- match: {hits.hits.0._source.geo_shape_0.type: "Polygon"}
143+
141144
# Test Point
142145
- do:
143146
index:

0 commit comments

Comments
 (0)