public void addFields(String indexName, List<ElasticsearchFieldInfo> fieldInfos) throws Exception {
        ElasticsearchIndexMappingInfo mappingInfo = getMappingInfo(fieldInfos);
        if (ObjectUtils.isNotEmpty(mappingInfo) && !mappingInfo.getMappings().getProperties().isEmpty()) {
            String url = esConfig.getOneHttpUrl() + InlongConstants.SLASH + indexName + "/_mapping";
            HttpUtils.request(esConfig.getRestClient(), url, HttpMethod.PUT,
                    GSON.toJsonTree(mappingInfo.getMappings()).getAsJsonObject().toString(), getHttpHeaders(),
                    Object.class);
        }
    }
Add fields by REST API.

@param indexName elasticsearch index name
@param fieldInfos elasticsearch field infos
@throws Exception any exception if occurred
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/resource/sink/es/ElasticsearchApi.java