RestHighLevelClient. How to create settings and mappings programmaticaly from json File?


#1

Hi, is it possible to do something like this with RestHighLevelClient?

public void createMapping() {
        Client client = transportClientFactory.getTransportClient();
        CreateIndexRequestBuilder createIndexRequestBuilder = client.admin().indices().prepareCreate(newIndexName);
        createIndexRequestBuilder.setSource(getIndexSettingsMappings());
        CreateIndexResponse createIndexResponse = createIndexRequestBuilder.execute().actionGet();
        if (!createIndexResponse.isAcknowledged()) {
            logger.error("Settings and mapping wasn't created for " + newIndexName);
        }
    }

Thank you in advance


(David Pilato) #2

No. You need to use the Low Level one (which you can get from the HL Client). For example:


(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.