Search in sources :

Example 1 with IndexTemplatesExistRequest

use of org.elasticsearch.client.indices.IndexTemplatesExistRequest in project spring-data-elasticsearch by spring-projects.

the class RestIndexTemplate method existsTemplate.

@Override
public boolean existsTemplate(ExistsTemplateRequest existsTemplateRequest) {
    Assert.notNull(existsTemplateRequest, "existsTemplateRequest must not be null");
    IndexTemplatesExistRequest putIndexTemplateRequest = requestFactory.indexTemplatesExistsRequest(existsTemplateRequest);
    return restTemplate.execute(client -> client.indices().existsTemplate(putIndexTemplateRequest, RequestOptions.DEFAULT));
}
Also used : IndexTemplatesExistRequest(org.elasticsearch.client.indices.IndexTemplatesExistRequest)

Example 2 with IndexTemplatesExistRequest

use of org.elasticsearch.client.indices.IndexTemplatesExistRequest in project kms by mahonelau.

the class KmEsMgntServiceImpl method checkTemplateExists.

private boolean checkTemplateExists(String templateName) throws IOException {
    IndexTemplatesExistRequest request = new IndexTemplatesExistRequest(templateName);
    boolean response = restHighLevelClient.indices().existsTemplate(request, RequestOptions.DEFAULT);
    return response;
}
Also used : IndexTemplatesExistRequest(org.elasticsearch.client.indices.IndexTemplatesExistRequest)

Example 3 with IndexTemplatesExistRequest

use of org.elasticsearch.client.indices.IndexTemplatesExistRequest in project spring-data-elasticsearch by spring-projects.

the class ReactiveIndexTemplate method existsTemplate.

@Override
public Mono<Boolean> existsTemplate(ExistsTemplateRequest existsTemplateRequest) {
    Assert.notNull(existsTemplateRequest, "existsTemplateRequest must not be null");
    IndexTemplatesExistRequest indexTemplatesExistRequest = requestFactory.indexTemplatesExistsRequest(existsTemplateRequest);
    return Mono.from(operations.executeWithIndicesClient(client -> client.existsTemplate(indexTemplatesExistRequest)));
}
Also used : AnnotatedElementUtils(org.springframework.core.annotation.AnnotatedElementUtils) GetMappingsRequest(org.elasticsearch.client.indices.GetMappingsRequest) AliasActions(org.springframework.data.elasticsearch.core.index.AliasActions) Settings(org.springframework.data.elasticsearch.core.index.Settings) PutIndexTemplateRequest(org.elasticsearch.client.indices.PutIndexTemplateRequest) InvalidDataAccessApiUsageException(org.springframework.dao.InvalidDataAccessApiUsageException) ElasticsearchPersistentEntity(org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentEntity) Mapping(org.springframework.data.elasticsearch.annotations.Mapping) ElasticsearchConverter(org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter) GetAliasesResponse(org.elasticsearch.client.GetAliasesResponse) Map(java.util.Map) Nullable(org.springframework.lang.Nullable) Requests(org.elasticsearch.client.Requests) AliasData(org.springframework.data.elasticsearch.core.index.AliasData) ReactiveMappingBuilder(org.springframework.data.elasticsearch.core.index.ReactiveMappingBuilder) TemplateData(org.springframework.data.elasticsearch.core.index.TemplateData) IndexTemplatesExistRequest(org.elasticsearch.client.indices.IndexTemplatesExistRequest) DeleteTemplateRequest(org.springframework.data.elasticsearch.core.index.DeleteTemplateRequest) ExistsTemplateRequest(org.springframework.data.elasticsearch.core.index.ExistsTemplateRequest) DeleteIndexRequest(org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest) CreateIndexRequest(org.elasticsearch.client.indices.CreateIndexRequest) IndexCoordinates(org.springframework.data.elasticsearch.core.mapping.IndexCoordinates) GetAliasesRequest(org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequest) GetIndexTemplatesRequest(org.elasticsearch.client.indices.GetIndexTemplatesRequest) Set(java.util.Set) IndicesAliasesRequest(org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest) Mono(reactor.core.publisher.Mono) PutTemplateRequest(org.springframework.data.elasticsearch.core.index.PutTemplateRequest) DeleteIndexTemplateRequest(org.elasticsearch.action.admin.indices.template.delete.DeleteIndexTemplateRequest) Flux(reactor.core.publisher.Flux) GetTemplateRequest(org.springframework.data.elasticsearch.core.index.GetTemplateRequest) NoSuchIndexException(org.springframework.data.elasticsearch.NoSuchIndexException) Log(org.apache.commons.logging.Log) LogFactory(org.apache.commons.logging.LogFactory) GetSettingsRequest(org.elasticsearch.action.admin.indices.settings.get.GetSettingsRequest) GetIndexRequest(org.elasticsearch.client.indices.GetIndexRequest) Document(org.springframework.data.elasticsearch.core.document.Document) StringUtils(org.springframework.util.StringUtils) Assert(org.springframework.util.Assert) IndexTemplatesExistRequest(org.elasticsearch.client.indices.IndexTemplatesExistRequest)

Example 4 with IndexTemplatesExistRequest

use of org.elasticsearch.client.indices.IndexTemplatesExistRequest in project spring-data-elasticsearch by spring-projects.

the class RequestConverters method templatesExist.

public static Request templatesExist(IndexTemplatesExistRequest indexTemplatesExistRequest) {
    final String endpoint = new RequestConverters.EndpointBuilder().addPathPartAsIs("_template").addCommaSeparatedPathParts(indexTemplatesExistRequest.names()).build();
    final Request request = new Request(HttpHead.METHOD_NAME, endpoint);
    final RequestConverters.Params params = new RequestConverters.Params(request);
    params.withLocal(indexTemplatesExistRequest.isLocal());
    params.withMasterTimeout(indexTemplatesExistRequest.getMasterNodeTimeout());
    return request;
}
Also used : ExplainRequest(org.elasticsearch.action.explain.ExplainRequest) GetMappingsRequest(org.elasticsearch.action.admin.indices.mapping.get.GetMappingsRequest) SearchTemplateRequest(org.elasticsearch.script.mustache.SearchTemplateRequest) DeleteRequest(org.elasticsearch.action.delete.DeleteRequest) IndexRequest(org.elasticsearch.action.index.IndexRequest) DeleteByQueryRequest(org.elasticsearch.index.reindex.DeleteByQueryRequest) FieldCapabilitiesRequest(org.elasticsearch.action.fieldcaps.FieldCapabilitiesRequest) CountRequest(org.elasticsearch.client.core.CountRequest) IndexTemplatesExistRequest(org.elasticsearch.client.indices.IndexTemplatesExistRequest) GetStoredScriptRequest(org.elasticsearch.action.admin.cluster.storedscripts.GetStoredScriptRequest) GetRequest(org.elasticsearch.action.get.GetRequest) RankEvalRequest(org.elasticsearch.index.rankeval.RankEvalRequest) GetAliasesRequest(org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequest) IndicesAliasesRequest(org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest) AbstractBulkByScrollRequest(org.elasticsearch.index.reindex.AbstractBulkByScrollRequest) DeleteIndexTemplateRequest(org.elasticsearch.action.admin.indices.template.delete.DeleteIndexTemplateRequest) ClusterHealthRequest(org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest) GetSettingsRequest(org.elasticsearch.action.admin.indices.settings.get.GetSettingsRequest) PutStoredScriptRequest(org.elasticsearch.action.admin.cluster.storedscripts.PutStoredScriptRequest) ClearScrollRequest(org.elasticsearch.action.search.ClearScrollRequest) PutIndexTemplateRequest(org.elasticsearch.client.indices.PutIndexTemplateRequest) DeleteStoredScriptRequest(org.elasticsearch.action.admin.cluster.storedscripts.DeleteStoredScriptRequest) MultiGetRequest(org.elasticsearch.action.get.MultiGetRequest) SearchRequest(org.elasticsearch.action.search.SearchRequest) OpenIndexRequest(org.elasticsearch.action.admin.indices.open.OpenIndexRequest) MultiSearchRequest(org.elasticsearch.action.search.MultiSearchRequest) CreateIndexRequest(org.elasticsearch.action.admin.indices.create.CreateIndexRequest) RefreshRequest(org.elasticsearch.action.admin.indices.refresh.RefreshRequest) UpdateByQueryRequest(org.elasticsearch.index.reindex.UpdateByQueryRequest) DeleteIndexRequest(org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest) GetIndexRequest(org.elasticsearch.action.admin.indices.get.GetIndexRequest) GetIndexTemplatesRequest(org.elasticsearch.client.indices.GetIndexTemplatesRequest) GetFieldMappingsRequest(org.elasticsearch.client.indices.GetFieldMappingsRequest) UpdateRequest(org.elasticsearch.action.update.UpdateRequest) DocWriteRequest(org.elasticsearch.action.DocWriteRequest) Request(org.elasticsearch.client.Request) AnalyzeRequest(org.elasticsearch.client.indices.AnalyzeRequest) CloseIndexRequest(org.elasticsearch.action.admin.indices.close.CloseIndexRequest) RethrottleRequest(org.elasticsearch.client.RethrottleRequest) FlushRequest(org.elasticsearch.action.admin.indices.flush.FlushRequest) PutMappingRequest(org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest) SearchScrollRequest(org.elasticsearch.action.search.SearchScrollRequest) BulkRequest(org.elasticsearch.action.bulk.BulkRequest) ReindexRequest(org.elasticsearch.index.reindex.ReindexRequest)

Aggregations

IndexTemplatesExistRequest (org.elasticsearch.client.indices.IndexTemplatesExistRequest)4 IndicesAliasesRequest (org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest)2 GetAliasesRequest (org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequest)2 DeleteIndexRequest (org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest)2 GetSettingsRequest (org.elasticsearch.action.admin.indices.settings.get.GetSettingsRequest)2 DeleteIndexTemplateRequest (org.elasticsearch.action.admin.indices.template.delete.DeleteIndexTemplateRequest)2 GetIndexTemplatesRequest (org.elasticsearch.client.indices.GetIndexTemplatesRequest)2 PutIndexTemplateRequest (org.elasticsearch.client.indices.PutIndexTemplateRequest)2 Map (java.util.Map)1 Set (java.util.Set)1 Log (org.apache.commons.logging.Log)1 LogFactory (org.apache.commons.logging.LogFactory)1 DocWriteRequest (org.elasticsearch.action.DocWriteRequest)1 ClusterHealthRequest (org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest)1 DeleteStoredScriptRequest (org.elasticsearch.action.admin.cluster.storedscripts.DeleteStoredScriptRequest)1 GetStoredScriptRequest (org.elasticsearch.action.admin.cluster.storedscripts.GetStoredScriptRequest)1 PutStoredScriptRequest (org.elasticsearch.action.admin.cluster.storedscripts.PutStoredScriptRequest)1 CloseIndexRequest (org.elasticsearch.action.admin.indices.close.CloseIndexRequest)1 CreateIndexRequest (org.elasticsearch.action.admin.indices.create.CreateIndexRequest)1 FlushRequest (org.elasticsearch.action.admin.indices.flush.FlushRequest)1