Search in sources :

Example 1 with PutTemplate

use of io.searchbox.indices.template.PutTemplate in project graylog2-server by Graylog2.

the class IndicesAdapterES6 method ensureIndexTemplate.

@Override
public boolean ensureIndexTemplate(String templateName, Map<String, Object> template) {
    final PutTemplate request = new PutTemplate.Builder(uncheckedURLEncode(templateName), template).build();
    final JestResult jestResult = JestUtils.execute(jestClient, request, () -> "Unable to create index template " + templateName);
    return jestResult.isSucceeded();
}
Also used : PutTemplate(io.searchbox.indices.template.PutTemplate) JestResult(io.searchbox.client.JestResult)

Example 2 with PutTemplate

use of io.searchbox.indices.template.PutTemplate in project graylog2-server by Graylog2.

the class ClientES6 method putTemplate.

@Override
public void putTemplate(String templateName, Map<String, Object> source) {
    final PutTemplate templateRequest = new PutTemplate.Builder(templateName, source).build();
    executeWithExpectedSuccess(templateRequest, "failed to put template " + templateName);
}
Also used : PutTemplate(io.searchbox.indices.template.PutTemplate)

Aggregations

PutTemplate (io.searchbox.indices.template.PutTemplate)2 JestResult (io.searchbox.client.JestResult)1