Vector tiles buffer is used to include data that is just outside of the tile. This data is used to prevent border effects when rendering the geometries. It is currently [hardcoded to 5 pixels](https://github.com/elastic/elasticsearch/blob/de2781f98696c1e6cfad2b5bf46fe752a5e3edbb/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/feature/FeatureFactory.java#L63) but it should probably need to be user configurable by adding a new property on the vector tiles API which can change the value.




x-pack/plugin/vector-tile/src/test/java/org/elasticsearch/xpack/vectortile/rest/VectorTileRequestTests.java
.startObject(fieldName)
                .field("script", "emit('foo')")
                .field("type", "string")
                .endObject()
                .endObject();
        }, (vectorTileRequest) -> {
            assertThat(vectorTileRequest.getRuntimeMappings(), Matchers.aMapWithSize(1));
            assertThat(vectorTileRequest.getRuntimeMappings().get(fieldName), Matchers.notNullValue());
        });
    }
    public void testDefaultFieldSort() throws IOException {
        assertRestRequest((builder) -> {}, (vectorTileRequest) -> {
            assertThat(vectorTileRequest.getSortBuilders(), Matchers.iterableWithSize(1));
            ScriptSortBuilder sortBuilder = (ScriptSortBuilder) vectorTileRequest.getSortBuilders().get(0);
            assertThat(sortBuilder.order(), Matchers.equalTo(SortOrder.DESC));
        });
    }
    public void testFieldSort() throws IOException {
        final String sortName = randomAlphaOfLength(10);
        assertRestRequest(
            (builder) -> {
                builder.startArray(SearchSourceBuilder.SORT_FIELD.getPreferredName())
                    .startObject()
                    .field(sortName, "desc")
                    .endObject()
                    .endArray();
            },
            (vectorTileRequest) -> {
                assertThat(vectorTileRequest.getSortBuilders(), Matchers.iterableWithSize(1));
                FieldSortBuilder sortBuilder = (FieldSortBuilder) vectorTileRequest.getSortBuilders().get(0);