Search in sources :

Example 21 with IndexCoordinates

use of org.springframework.data.elasticsearch.core.mapping.IndexCoordinates in project spring-data-elasticsearch by spring-projects.

the class ReactiveElasticsearchTemplate method multiGet.

@Override
public <T> Flux<MultiGetItem<T>> multiGet(Query query, Class<T> clazz, IndexCoordinates index) {
    Assert.notNull(index, "Index must not be null");
    Assert.notNull(clazz, "Class must not be null");
    Assert.notNull(query, "Query must not be null");
    DocumentCallback<T> callback = new ReadDocumentCallback<>(converter, clazz, index);
    MultiGetRequest request = requestFactory.multiGetRequest(query, clazz, index);
    return // 
    Flux.from(execute(client -> client.multiGet(request))).map(// 
    DocumentAdapters::from).flatMap(multiGetItem -> // 
    multiGetItem.isFailed() ? // 
    Mono.just(MultiGetItem.of(null, multiGetItem.getFailure())) : callback.toEntity(multiGetItem.getItem()).map(// 
    (T item) -> MultiGetItem.of(item, multiGetItem.getFailure())));
}
Also used : DefaultReactiveClusterOperations(org.springframework.data.elasticsearch.core.cluster.DefaultReactiveClusterOperations) QueryBuilders(org.elasticsearch.index.query.QueryBuilders) ElasticsearchPersistentEntity(org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentEntity) PersistentPropertyAccessor(org.springframework.data.mapping.PersistentPropertyAccessor) BulkFailureException(org.springframework.data.elasticsearch.BulkFailureException) DeleteRequest(org.elasticsearch.action.delete.DeleteRequest) IndexRequest(org.elasticsearch.action.index.IndexRequest) ReindexRequest(org.springframework.data.elasticsearch.core.reindex.ReindexRequest) VersionInfo(org.springframework.data.elasticsearch.support.VersionInfo) MappingElasticsearchConverter(org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter) Map(java.util.Map) RoutingResolver(org.springframework.data.elasticsearch.core.routing.RoutingResolver) IndicesOptions(org.elasticsearch.action.support.IndicesOptions) DeleteByQueryRequest(org.elasticsearch.index.reindex.DeleteByQueryRequest) ElasticsearchPersistentProperty(org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentProperty) GetRequest(org.elasticsearch.action.get.GetRequest) ReactiveEntityCallbacks(org.springframework.data.mapping.callback.ReactiveEntityCallbacks) IndexCoordinates(org.springframework.data.elasticsearch.core.mapping.IndexCoordinates) UpdateQuery(org.springframework.data.elasticsearch.core.query.UpdateQuery) BulkItemResponse(org.elasticsearch.action.bulk.BulkItemResponse) ReactiveClusterOperations(org.springframework.data.elasticsearch.core.cluster.ReactiveClusterOperations) Collection(java.util.Collection) BulkResponse(org.elasticsearch.action.bulk.BulkResponse) IndexQuery(org.springframework.data.elasticsearch.core.query.IndexQuery) Collectors(java.util.stream.Collectors) List(java.util.List) Version(org.elasticsearch.Version) NonNull(org.springframework.lang.NonNull) LogFactory(org.apache.commons.logging.LogFactory) SearchDocument(org.springframework.data.elasticsearch.core.document.SearchDocument) ApplicationContextAware(org.springframework.context.ApplicationContextAware) Document(org.springframework.data.elasticsearch.core.document.Document) ReactiveBeforeConvertCallback(org.springframework.data.elasticsearch.core.event.ReactiveBeforeConvertCallback) ReactiveAfterSaveCallback(org.springframework.data.elasticsearch.core.event.ReactiveAfterSaveCallback) SeqNoPrimaryTerm(org.springframework.data.elasticsearch.core.query.SeqNoPrimaryTerm) Suggest(org.springframework.data.elasticsearch.core.suggest.response.Suggest) GetResult(org.elasticsearch.index.get.GetResult) Tuple2(reactor.util.function.Tuple2) MultiGetRequest(org.elasticsearch.action.get.MultiGetRequest) HashMap(java.util.HashMap) Query(org.springframework.data.elasticsearch.core.query.Query) SearchRequest(org.elasticsearch.action.search.SearchRequest) BulkOptions(org.springframework.data.elasticsearch.core.query.BulkOptions) EntityReader(org.springframework.data.convert.EntityReader) SearchDocumentResponse(org.springframework.data.elasticsearch.core.document.SearchDocumentResponse) WriteRequest(org.elasticsearch.action.support.WriteRequest) DocumentAdapters(org.springframework.data.elasticsearch.core.document.DocumentAdapters) ByQueryResponse(org.springframework.data.elasticsearch.core.query.ByQueryResponse) ElasticsearchConverter(org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter) ReactiveAfterLoadCallback(org.springframework.data.elasticsearch.core.event.ReactiveAfterLoadCallback) IndexResponse(org.elasticsearch.action.index.IndexResponse) Nullable(org.springframework.lang.Nullable) UpdateResponse(org.springframework.data.elasticsearch.core.query.UpdateResponse) UpdateByQueryRequest(org.elasticsearch.index.reindex.UpdateByQueryRequest) BulkByScrollResponse(org.elasticsearch.index.reindex.BulkByScrollResponse) Publisher(org.reactivestreams.Publisher) Mono(reactor.core.publisher.Mono) UpdateRequest(org.elasticsearch.action.update.UpdateRequest) BeansException(org.springframework.beans.BeansException) SimpleElasticsearchMappingContext(org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext) ReactiveElasticsearchClient(org.springframework.data.elasticsearch.client.reactive.ReactiveElasticsearchClient) DocWriteResponse(org.elasticsearch.action.DocWriteResponse) ApplicationContext(org.springframework.context.ApplicationContext) SuggestBuilder(org.elasticsearch.search.suggest.SuggestBuilder) Flux(reactor.core.publisher.Flux) HttpStatus(org.springframework.http.HttpStatus) AdaptibleEntity(org.springframework.data.elasticsearch.core.EntityOperations.AdaptibleEntity) ReactiveAfterConvertCallback(org.springframework.data.elasticsearch.core.event.ReactiveAfterConvertCallback) NoSuchIndexException(org.springframework.data.elasticsearch.NoSuchIndexException) DefaultRoutingResolver(org.springframework.data.elasticsearch.core.routing.DefaultRoutingResolver) Log(org.apache.commons.logging.Log) NativeSearchQueryBuilder(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder) BulkRequest(org.elasticsearch.action.bulk.BulkRequest) ReindexResponse(org.springframework.data.elasticsearch.core.reindex.ReindexResponse) UncategorizedElasticsearchException(org.springframework.data.elasticsearch.UncategorizedElasticsearchException) Assert(org.springframework.util.Assert) MultiGetRequest(org.elasticsearch.action.get.MultiGetRequest)

Example 22 with IndexCoordinates

use of org.springframework.data.elasticsearch.core.mapping.IndexCoordinates in project spring-data-elasticsearch by spring-projects.

the class ReactiveElasticsearchTemplate method updateByQuery.

@Override
public Mono<ByQueryResponse> updateByQuery(UpdateQuery updateQuery, IndexCoordinates index) {
    Assert.notNull(updateQuery, "updateQuery must not be null");
    Assert.notNull(index, "Index must not be null");
    return Mono.defer(() -> {
        final UpdateByQueryRequest request = requestFactory.updateByQueryRequest(updateQuery, index);
        if (updateQuery.getRefreshPolicy() == null && refreshPolicy != null) {
            request.setRefresh(refreshPolicy == RefreshPolicy.IMMEDIATE);
        }
        if (updateQuery.getRouting() == null && routingResolver.getRouting() != null) {
            request.setRouting(routingResolver.getRouting());
        }
        return Mono.from(execute(client -> client.updateBy(request)));
    });
}
Also used : DefaultReactiveClusterOperations(org.springframework.data.elasticsearch.core.cluster.DefaultReactiveClusterOperations) QueryBuilders(org.elasticsearch.index.query.QueryBuilders) ElasticsearchPersistentEntity(org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentEntity) PersistentPropertyAccessor(org.springframework.data.mapping.PersistentPropertyAccessor) BulkFailureException(org.springframework.data.elasticsearch.BulkFailureException) DeleteRequest(org.elasticsearch.action.delete.DeleteRequest) IndexRequest(org.elasticsearch.action.index.IndexRequest) ReindexRequest(org.springframework.data.elasticsearch.core.reindex.ReindexRequest) VersionInfo(org.springframework.data.elasticsearch.support.VersionInfo) MappingElasticsearchConverter(org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter) Map(java.util.Map) RoutingResolver(org.springframework.data.elasticsearch.core.routing.RoutingResolver) IndicesOptions(org.elasticsearch.action.support.IndicesOptions) DeleteByQueryRequest(org.elasticsearch.index.reindex.DeleteByQueryRequest) ElasticsearchPersistentProperty(org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentProperty) GetRequest(org.elasticsearch.action.get.GetRequest) ReactiveEntityCallbacks(org.springframework.data.mapping.callback.ReactiveEntityCallbacks) IndexCoordinates(org.springframework.data.elasticsearch.core.mapping.IndexCoordinates) UpdateQuery(org.springframework.data.elasticsearch.core.query.UpdateQuery) BulkItemResponse(org.elasticsearch.action.bulk.BulkItemResponse) ReactiveClusterOperations(org.springframework.data.elasticsearch.core.cluster.ReactiveClusterOperations) Collection(java.util.Collection) BulkResponse(org.elasticsearch.action.bulk.BulkResponse) IndexQuery(org.springframework.data.elasticsearch.core.query.IndexQuery) Collectors(java.util.stream.Collectors) List(java.util.List) Version(org.elasticsearch.Version) NonNull(org.springframework.lang.NonNull) LogFactory(org.apache.commons.logging.LogFactory) SearchDocument(org.springframework.data.elasticsearch.core.document.SearchDocument) ApplicationContextAware(org.springframework.context.ApplicationContextAware) Document(org.springframework.data.elasticsearch.core.document.Document) ReactiveBeforeConvertCallback(org.springframework.data.elasticsearch.core.event.ReactiveBeforeConvertCallback) ReactiveAfterSaveCallback(org.springframework.data.elasticsearch.core.event.ReactiveAfterSaveCallback) SeqNoPrimaryTerm(org.springframework.data.elasticsearch.core.query.SeqNoPrimaryTerm) Suggest(org.springframework.data.elasticsearch.core.suggest.response.Suggest) GetResult(org.elasticsearch.index.get.GetResult) Tuple2(reactor.util.function.Tuple2) MultiGetRequest(org.elasticsearch.action.get.MultiGetRequest) HashMap(java.util.HashMap) Query(org.springframework.data.elasticsearch.core.query.Query) SearchRequest(org.elasticsearch.action.search.SearchRequest) BulkOptions(org.springframework.data.elasticsearch.core.query.BulkOptions) EntityReader(org.springframework.data.convert.EntityReader) SearchDocumentResponse(org.springframework.data.elasticsearch.core.document.SearchDocumentResponse) WriteRequest(org.elasticsearch.action.support.WriteRequest) DocumentAdapters(org.springframework.data.elasticsearch.core.document.DocumentAdapters) ByQueryResponse(org.springframework.data.elasticsearch.core.query.ByQueryResponse) ElasticsearchConverter(org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter) ReactiveAfterLoadCallback(org.springframework.data.elasticsearch.core.event.ReactiveAfterLoadCallback) IndexResponse(org.elasticsearch.action.index.IndexResponse) Nullable(org.springframework.lang.Nullable) UpdateResponse(org.springframework.data.elasticsearch.core.query.UpdateResponse) UpdateByQueryRequest(org.elasticsearch.index.reindex.UpdateByQueryRequest) BulkByScrollResponse(org.elasticsearch.index.reindex.BulkByScrollResponse) Publisher(org.reactivestreams.Publisher) Mono(reactor.core.publisher.Mono) UpdateRequest(org.elasticsearch.action.update.UpdateRequest) BeansException(org.springframework.beans.BeansException) SimpleElasticsearchMappingContext(org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext) ReactiveElasticsearchClient(org.springframework.data.elasticsearch.client.reactive.ReactiveElasticsearchClient) DocWriteResponse(org.elasticsearch.action.DocWriteResponse) ApplicationContext(org.springframework.context.ApplicationContext) SuggestBuilder(org.elasticsearch.search.suggest.SuggestBuilder) Flux(reactor.core.publisher.Flux) HttpStatus(org.springframework.http.HttpStatus) AdaptibleEntity(org.springframework.data.elasticsearch.core.EntityOperations.AdaptibleEntity) ReactiveAfterConvertCallback(org.springframework.data.elasticsearch.core.event.ReactiveAfterConvertCallback) NoSuchIndexException(org.springframework.data.elasticsearch.NoSuchIndexException) DefaultRoutingResolver(org.springframework.data.elasticsearch.core.routing.DefaultRoutingResolver) Log(org.apache.commons.logging.Log) NativeSearchQueryBuilder(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder) BulkRequest(org.elasticsearch.action.bulk.BulkRequest) ReindexResponse(org.springframework.data.elasticsearch.core.reindex.ReindexResponse) UncategorizedElasticsearchException(org.springframework.data.elasticsearch.UncategorizedElasticsearchException) Assert(org.springframework.util.Assert) UpdateByQueryRequest(org.elasticsearch.index.reindex.UpdateByQueryRequest)

Example 23 with IndexCoordinates

use of org.springframework.data.elasticsearch.core.mapping.IndexCoordinates in project spring-data-elasticsearch by spring-projects.

the class ReactiveIndexTemplate method getMapping.

@Override
public Mono<Document> getMapping() {
    IndexCoordinates indexCoordinates = getIndexCoordinates();
    GetMappingsRequest request = requestFactory.getMappingsRequest(indexCoordinates);
    return Mono.from(operations.executeWithIndicesClient(client -> client.getMapping(request))).flatMap(getMappingsResponse -> {
        Map<String, Object> source = getMappingsResponse.mappings().get(indexCoordinates.getIndexName()).getSourceAsMap();
        Document document = Document.from(source);
        return Mono.just(document);
    });
}
Also used : Document(org.springframework.data.elasticsearch.core.document.Document) GetMappingsRequest(org.elasticsearch.client.indices.GetMappingsRequest) IndexCoordinates(org.springframework.data.elasticsearch.core.mapping.IndexCoordinates)

Example 24 with IndexCoordinates

use of org.springframework.data.elasticsearch.core.mapping.IndexCoordinates in project spring-data-elasticsearch by spring-projects.

the class ElasticsearchRestTemplate method count.

// endregion
// region SearchOperations
@Override
public long count(Query query, @Nullable Class<?> clazz, IndexCoordinates index) {
    Assert.notNull(query, "query must not be null");
    Assert.notNull(index, "index must not be null");
    final Boolean trackTotalHits = query.getTrackTotalHits();
    query.setTrackTotalHits(true);
    SearchRequest searchRequest = requestFactory.searchRequest(query, clazz, index);
    query.setTrackTotalHits(trackTotalHits);
    searchRequest.source().size(0);
    return SearchHitsUtil.getTotalCount(execute(client -> client.search(searchRequest, RequestOptions.DEFAULT).getHits()));
}
Also used : GetResponse(org.elasticsearch.action.get.GetResponse) ClusterOperations(org.springframework.data.elasticsearch.core.cluster.ClusterOperations) MoreLikeThisQuery(org.springframework.data.elasticsearch.core.query.MoreLikeThisQuery) QueryBuilders(org.elasticsearch.index.query.QueryBuilders) BulkFailureException(org.springframework.data.elasticsearch.BulkFailureException) DeleteRequest(org.elasticsearch.action.delete.DeleteRequest) IndexRequest(org.elasticsearch.action.index.IndexRequest) ReindexRequest(org.springframework.data.elasticsearch.core.reindex.ReindexRequest) Map(java.util.Map) SearchResponse(org.elasticsearch.action.search.SearchResponse) RequestOptions(org.elasticsearch.client.RequestOptions) DeleteByQueryRequest(org.elasticsearch.index.reindex.DeleteByQueryRequest) TimeValue(org.elasticsearch.core.TimeValue) GetRequest(org.elasticsearch.action.get.GetRequest) MultiGetResponse(org.elasticsearch.action.get.MultiGetResponse) IndexCoordinates(org.springframework.data.elasticsearch.core.mapping.IndexCoordinates) UpdateQuery(org.springframework.data.elasticsearch.core.query.UpdateQuery) BulkItemResponse(org.elasticsearch.action.bulk.BulkItemResponse) BulkResponse(org.elasticsearch.action.bulk.BulkResponse) IndexQuery(org.springframework.data.elasticsearch.core.query.IndexQuery) Collectors(java.util.stream.Collectors) MultiSearchResponse(org.elasticsearch.action.search.MultiSearchResponse) List(java.util.List) Stream(java.util.stream.Stream) Version(org.elasticsearch.Version) LogFactory(org.apache.commons.logging.LogFactory) FetchSourceContext(org.elasticsearch.search.fetch.subphase.FetchSourceContext) ClearScrollRequest(org.elasticsearch.action.search.ClearScrollRequest) MultiGetRequest(org.elasticsearch.action.get.MultiGetRequest) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) Query(org.springframework.data.elasticsearch.core.query.Query) SearchRequest(org.elasticsearch.action.search.SearchRequest) ElasticsearchClusterOperations(org.springframework.data.elasticsearch.core.cluster.ElasticsearchClusterOperations) BulkOptions(org.springframework.data.elasticsearch.core.query.BulkOptions) ArrayList(java.util.ArrayList) SearchDocumentResponse(org.springframework.data.elasticsearch.core.document.SearchDocumentResponse) WriteRequest(org.elasticsearch.action.support.WriteRequest) DocumentAdapters(org.springframework.data.elasticsearch.core.document.DocumentAdapters) ByQueryResponse(org.springframework.data.elasticsearch.core.query.ByQueryResponse) ElasticsearchConverter(org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter) MultiSearchRequest(org.elasticsearch.action.search.MultiSearchRequest) IndexResponse(org.elasticsearch.action.index.IndexResponse) Nullable(org.springframework.lang.Nullable) MoreLikeThisQueryBuilder(org.elasticsearch.index.query.MoreLikeThisQueryBuilder) UpdateResponse(org.springframework.data.elasticsearch.core.query.UpdateResponse) UpdateByQueryRequest(org.elasticsearch.index.reindex.UpdateByQueryRequest) BulkByScrollResponse(org.elasticsearch.index.reindex.BulkByScrollResponse) Iterator(java.util.Iterator) IOException(java.io.IOException) UpdateRequest(org.elasticsearch.action.update.UpdateRequest) DocWriteResponse(org.elasticsearch.action.DocWriteResponse) RestHighLevelClient(org.elasticsearch.client.RestHighLevelClient) SuggestBuilder(org.elasticsearch.search.suggest.SuggestBuilder) Log(org.apache.commons.logging.Log) NativeSearchQueryBuilder(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder) SearchScrollRequest(org.elasticsearch.action.search.SearchScrollRequest) BulkRequest(org.elasticsearch.action.bulk.BulkRequest) ReindexResponse(org.springframework.data.elasticsearch.core.reindex.ReindexResponse) Assert(org.springframework.util.Assert) SearchRequest(org.elasticsearch.action.search.SearchRequest) MultiSearchRequest(org.elasticsearch.action.search.MultiSearchRequest)

Example 25 with IndexCoordinates

use of org.springframework.data.elasticsearch.core.mapping.IndexCoordinates in project spring-data-elasticsearch by spring-projects.

the class ElasticsearchRestTemplate method update.

@Override
public UpdateResponse update(UpdateQuery query, IndexCoordinates index) {
    UpdateRequest request = requestFactory.updateRequest(query, index);
    if (query.getRefreshPolicy() == null && getRefreshPolicy() != null) {
        request.setRefreshPolicy(RequestFactory.toElasticsearchRefreshPolicy(getRefreshPolicy()));
    }
    if (query.getRouting() == null && routingResolver.getRouting() != null) {
        request.routing(routingResolver.getRouting());
    }
    UpdateResponse.Result result = UpdateResponse.Result.valueOf(execute(client -> client.update(request, RequestOptions.DEFAULT)).getResult().name());
    return new UpdateResponse(result);
}
Also used : GetResponse(org.elasticsearch.action.get.GetResponse) ClusterOperations(org.springframework.data.elasticsearch.core.cluster.ClusterOperations) MoreLikeThisQuery(org.springframework.data.elasticsearch.core.query.MoreLikeThisQuery) QueryBuilders(org.elasticsearch.index.query.QueryBuilders) BulkFailureException(org.springframework.data.elasticsearch.BulkFailureException) DeleteRequest(org.elasticsearch.action.delete.DeleteRequest) IndexRequest(org.elasticsearch.action.index.IndexRequest) ReindexRequest(org.springframework.data.elasticsearch.core.reindex.ReindexRequest) Map(java.util.Map) SearchResponse(org.elasticsearch.action.search.SearchResponse) RequestOptions(org.elasticsearch.client.RequestOptions) DeleteByQueryRequest(org.elasticsearch.index.reindex.DeleteByQueryRequest) TimeValue(org.elasticsearch.core.TimeValue) GetRequest(org.elasticsearch.action.get.GetRequest) MultiGetResponse(org.elasticsearch.action.get.MultiGetResponse) IndexCoordinates(org.springframework.data.elasticsearch.core.mapping.IndexCoordinates) UpdateQuery(org.springframework.data.elasticsearch.core.query.UpdateQuery) BulkItemResponse(org.elasticsearch.action.bulk.BulkItemResponse) BulkResponse(org.elasticsearch.action.bulk.BulkResponse) IndexQuery(org.springframework.data.elasticsearch.core.query.IndexQuery) Collectors(java.util.stream.Collectors) MultiSearchResponse(org.elasticsearch.action.search.MultiSearchResponse) List(java.util.List) Stream(java.util.stream.Stream) Version(org.elasticsearch.Version) LogFactory(org.apache.commons.logging.LogFactory) FetchSourceContext(org.elasticsearch.search.fetch.subphase.FetchSourceContext) ClearScrollRequest(org.elasticsearch.action.search.ClearScrollRequest) MultiGetRequest(org.elasticsearch.action.get.MultiGetRequest) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) Query(org.springframework.data.elasticsearch.core.query.Query) SearchRequest(org.elasticsearch.action.search.SearchRequest) ElasticsearchClusterOperations(org.springframework.data.elasticsearch.core.cluster.ElasticsearchClusterOperations) BulkOptions(org.springframework.data.elasticsearch.core.query.BulkOptions) ArrayList(java.util.ArrayList) SearchDocumentResponse(org.springframework.data.elasticsearch.core.document.SearchDocumentResponse) WriteRequest(org.elasticsearch.action.support.WriteRequest) DocumentAdapters(org.springframework.data.elasticsearch.core.document.DocumentAdapters) ByQueryResponse(org.springframework.data.elasticsearch.core.query.ByQueryResponse) ElasticsearchConverter(org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter) MultiSearchRequest(org.elasticsearch.action.search.MultiSearchRequest) IndexResponse(org.elasticsearch.action.index.IndexResponse) Nullable(org.springframework.lang.Nullable) MoreLikeThisQueryBuilder(org.elasticsearch.index.query.MoreLikeThisQueryBuilder) UpdateResponse(org.springframework.data.elasticsearch.core.query.UpdateResponse) UpdateByQueryRequest(org.elasticsearch.index.reindex.UpdateByQueryRequest) BulkByScrollResponse(org.elasticsearch.index.reindex.BulkByScrollResponse) Iterator(java.util.Iterator) IOException(java.io.IOException) UpdateRequest(org.elasticsearch.action.update.UpdateRequest) DocWriteResponse(org.elasticsearch.action.DocWriteResponse) RestHighLevelClient(org.elasticsearch.client.RestHighLevelClient) SuggestBuilder(org.elasticsearch.search.suggest.SuggestBuilder) Log(org.apache.commons.logging.Log) NativeSearchQueryBuilder(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder) SearchScrollRequest(org.elasticsearch.action.search.SearchScrollRequest) BulkRequest(org.elasticsearch.action.bulk.BulkRequest) ReindexResponse(org.springframework.data.elasticsearch.core.reindex.ReindexResponse) Assert(org.springframework.util.Assert) UpdateResponse(org.springframework.data.elasticsearch.core.query.UpdateResponse) UpdateRequest(org.elasticsearch.action.update.UpdateRequest)

Aggregations

IndexCoordinates (org.springframework.data.elasticsearch.core.mapping.IndexCoordinates)50 Test (org.junit.jupiter.api.Test)27 SpringIntegrationTest (org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest)27 IndexQuery (org.springframework.data.elasticsearch.core.query.IndexQuery)20 NativeSearchQueryBuilder (org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder)16 Query (org.springframework.data.elasticsearch.core.query.Query)16 ArrayList (java.util.ArrayList)15 Nullable (org.springframework.lang.Nullable)11 HashMap (java.util.HashMap)10 List (java.util.List)10 Collectors (java.util.stream.Collectors)10 QueryBuilders (org.elasticsearch.index.query.QueryBuilders)10 Map (java.util.Map)9 SearchRequest (org.elasticsearch.action.search.SearchRequest)9 UpdateRequest (org.elasticsearch.action.update.UpdateRequest)9 Log (org.apache.commons.logging.Log)8 LogFactory (org.apache.commons.logging.LogFactory)8 Version (org.elasticsearch.Version)8 DocWriteResponse (org.elasticsearch.action.DocWriteResponse)8 BulkItemResponse (org.elasticsearch.action.bulk.BulkItemResponse)8