@SneakyThrows
    @Override
    public HttpRequest createOrUpdate(String name, Map<String, ?> settings,
                                      Mappings mappings, int order) {
        final String[] patterns = new String[] {name + "-*"};
        final Map<String, Object> aliases = ImmutableMap.of(name, Collections.emptyMap());
        final Map<String, Object> template =
            ImmutableMap.<String, Object>builder()
                        .put("index_patterns", patterns)
                        .put("aliases", aliases)
                        .put("settings", settings)
                        .put("mappings", mappings)
                        .put("order", order)
                        .build();

        final byte[] content = version.codec().encode(template);

        return HttpRequest.builder()
                          .put("/_template/{name}")
                          .pathParam("name", name)
                          .content(MediaType.JSON, content)
                          .build();
    }
This request factory is about legacy index templates, which are deprecated and will be replaced
by the composable templates introduced in Elasticsearch 7.8. For information about composable
templates, see Index templates, https://www.elastic.co/guide/en/elasticsearch/reference/current/index-templates.html
oap-server/server-library/library-elasticsearch-client/src/main/java/org/apache/skywalking/library/elasticsearch/requests/factory/v6/V6TemplateFactory.java