@@ -120,6 +120,10 @@ private void createIndexAndPutGeometry(String indexName, Geometry geometry, Stri
120
120
},
121
121
"name": {
122
122
"type": "keyword"
123
+ },
124
+ "ignore_value": {
125
+ "type": "double",
126
+ "ignore_malformed" : true
123
127
}
124
128
}
125
129
}""" );
@@ -129,7 +133,7 @@ private void createIndexAndPutGeometry(String indexName, Geometry geometry, Stri
129
133
final Request putRequest = new Request (HttpPost .METHOD_NAME , indexName + "/_doc/" + id );
130
134
putRequest .setJsonEntity ("""
131
135
{
132
- "location": "%s", "name": "geometry", "value1": %s, "value2": %s, "nullField" : null
136
+ "location": "%s", "name": "geometry", "value1": %s, "value2": %s, "nullField" : null, "ignore_value" : ""
133
137
}""" .formatted (WellKnownText .toWKT (geometry ), 1 , 2 ));
134
138
response = client ().performRequest (putRequest );
135
139
assertThat (response .getStatusLine ().getStatusCode (), Matchers .equalTo (HttpStatus .SC_CREATED ));
@@ -653,6 +657,16 @@ public void testWithNullFields() throws Exception {
653
657
assertLayer (tile , META_LAYER , 4096 , 1 , 13 );
654
658
}
655
659
660
+ public void testWithIgnoreMalformedValueFields () throws Exception {
661
+ final Request mvtRequest = new Request (getHttpMethod (), INDEX_POLYGON + "/_mvt/location/" + z + "/" + x + "/" + y );
662
+ mvtRequest .setJsonEntity ("{\" fields\" : [ \" ignore_value\" ] }" );
663
+ final VectorTile .Tile tile = execute (mvtRequest );
664
+ assertThat (tile .getLayersCount (), Matchers .equalTo (3 ));
665
+ assertLayer (tile , HITS_LAYER , 4096 , 1 , 2 );
666
+ assertLayer (tile , AGGS_LAYER , 4096 , 256 * 256 , 2 );
667
+ assertLayer (tile , META_LAYER , 4096 , 1 , 13 );
668
+ }
669
+
656
670
public void testWithFieldsWildCard () throws Exception {
657
671
final Request mvtRequest = new Request (getHttpMethod (), INDEX_POLYGON + "/_mvt/location/" + z + "/" + x + "/" + y );
658
672
mvtRequest .setJsonEntity ("{\" fields\" : [\" *\" ] }" );
0 commit comments