use of org.graylog.shaded.elasticsearch7.org.elasticsearch.client.RequestOptions in project graylog2-server by Graylog2.
the class ElasticsearchClient method search.
public SearchResponse search(SearchRequest searchRequest, String errorMessage) {
final MultiSearchRequest multiSearchRequest = new MultiSearchRequest().add(searchRequest);
final MultiSearchResponse result = this.execute((c, requestOptions) -> c.msearch(multiSearchRequest, requestOptions), errorMessage);
return firstResponseFrom(result, errorMessage);
}
use of org.graylog.shaded.elasticsearch7.org.elasticsearch.client.RequestOptions in project graylog2-server by Graylog2.
the class IndicesAdapterES7 method create.
@Override
public void create(String index, IndexSettings indexSettings) {
final Map<String, Object> settings = new HashMap<>();
settings.put("number_of_shards", indexSettings.shards());
settings.put("number_of_replicas", indexSettings.replicas());
final CreateIndexRequest request = new CreateIndexRequest(index).settings(settings);
client.execute((c, requestOptions) -> c.indices().create(request, requestOptions), "Unable to create index " + index);
}
use of org.graylog.shaded.elasticsearch7.org.elasticsearch.client.RequestOptions in project graylog2-server by Graylog2.
the class IndicesAdapterES7 method delete.
@Override
public void delete(String index) {
final DeleteIndexRequest request = new DeleteIndexRequest(index);
client.execute((c, requestOptions) -> c.indices().delete(request, requestOptions));
}
use of org.graylog.shaded.elasticsearch7.org.elasticsearch.client.RequestOptions in project graylog2-server by Graylog2.
the class IndicesAdapterES7 method deleteIndexTemplate.
@Override
public boolean deleteIndexTemplate(String templateName) {
final DeleteIndexTemplateRequest request = new DeleteIndexTemplateRequest(templateName);
final AcknowledgedResponse result = client.execute((c, requestOptions) -> c.indices().deleteTemplate(request, requestOptions), "Unable to delete index template " + templateName);
return result.isAcknowledged();
}
use of org.graylog.shaded.elasticsearch7.org.elasticsearch.client.RequestOptions in project graylog2-server by Graylog2.
the class IndicesAdapterES7 method resolveAlias.
@Override
public Set<String> resolveAlias(String alias) {
final GetAliasesRequest request = new GetAliasesRequest().aliases(alias);
final GetAliasesResponse result = client.execute((c, requestOptions) -> c.indices().getAlias(request, requestOptions));
return result.getAliases().keySet();
}
Aggregations