mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-06-30 15:52:12 +00:00
Polishing
This commit is contained in:
parent
b0c2ce3084
commit
cf9b106c31
@ -468,7 +468,7 @@ public class ElasticsearchTemplate extends AbstractElasticsearchTemplate {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SearchHits<?>> multiSearch(List<? extends Query> queries, List<Class<?>> classes,
|
public List<SearchHits<?>> multiSearch(List<? extends Query> queries, List<Class<?>> classes,
|
||||||
List<IndexCoordinates> indexes) {
|
List<IndexCoordinates> indexes) {
|
||||||
|
|
||||||
Assert.notNull(queries, "queries must not be null");
|
Assert.notNull(queries, "queries must not be null");
|
||||||
Assert.notNull(classes, "classes must not be null");
|
Assert.notNull(classes, "classes must not be null");
|
||||||
@ -652,9 +652,8 @@ public class ElasticsearchTemplate extends AbstractElasticsearchTemplate {
|
|||||||
failedDocuments);
|
failedDocuments);
|
||||||
}
|
}
|
||||||
|
|
||||||
return bulkResponse.items().stream()
|
return bulkResponse.items().stream().map(
|
||||||
.map(item -> new IndexedObjectInformation(item.id(), item.index(), item.seqNo(), item.primaryTerm(),
|
item -> new IndexedObjectInformation(item.id(), item.index(), item.seqNo(), item.primaryTerm(), item.version()))
|
||||||
item.version()))
|
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -381,8 +381,7 @@ public class ElasticsearchRestTemplate extends AbstractElasticsearchTemplate {
|
|||||||
response.getPrimaryTerm(), //
|
response.getPrimaryTerm(), //
|
||||||
response.getVersion());
|
response.getVersion());
|
||||||
} else {
|
} else {
|
||||||
return new IndexedObjectInformation(bulkItemResponse.getId(), bulkItemResponse.getIndex(), null, null,
|
return new IndexedObjectInformation(bulkItemResponse.getId(), bulkItemResponse.getIndex(), null, null, null);
|
||||||
null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
@ -561,7 +560,7 @@ public class ElasticsearchRestTemplate extends AbstractElasticsearchTemplate {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SearchHits<?>> multiSearch(List<? extends Query> queries, List<Class<?>> classes,
|
public List<SearchHits<?>> multiSearch(List<? extends Query> queries, List<Class<?>> classes,
|
||||||
List<IndexCoordinates> indexes) {
|
List<IndexCoordinates> indexes) {
|
||||||
|
|
||||||
Assert.notNull(queries, "queries must not be null");
|
Assert.notNull(queries, "queries must not be null");
|
||||||
Assert.notNull(classes, "classes must not be null");
|
Assert.notNull(classes, "classes must not be null");
|
||||||
|
@ -140,8 +140,10 @@ public interface SearchOperations {
|
|||||||
* @param classes the entity classes used for property mapping
|
* @param classes the entity classes used for property mapping
|
||||||
* @param indexes the indexes to run the queries against
|
* @param indexes the indexes to run the queries against
|
||||||
* @return list of SearchHits
|
* @return list of SearchHits
|
||||||
|
* @since 5.1
|
||||||
*/
|
*/
|
||||||
List<SearchHits<?>> multiSearch(List<? extends Query> queries, List<Class<?>> classes, List<IndexCoordinates> indexes);
|
List<SearchHits<?>> multiSearch(List<? extends Query> queries, List<Class<?>> classes,
|
||||||
|
List<IndexCoordinates> indexes);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute the criteria query against elasticsearch and return result as {@link SearchHits}
|
* Execute the criteria query against elasticsearch and return result as {@link SearchHits}
|
||||||
@ -232,19 +234,20 @@ public interface SearchOperations {
|
|||||||
/**
|
/**
|
||||||
* Opens a point in time (pit) in Elasticsearch.
|
* Opens a point in time (pit) in Elasticsearch.
|
||||||
*
|
*
|
||||||
* @param index the index name(s) to use
|
* @param index the index name(s) to use
|
||||||
* @param keepAlive the duration the pit shoult be kept alive
|
* @param keepAlive the duration the pit shoult be kept alive
|
||||||
* @return the pit identifier
|
* @return the pit identifier
|
||||||
* @since 5.0
|
* @since 5.0
|
||||||
*/
|
*/
|
||||||
default String openPointInTime(IndexCoordinates index, Duration keepAlive) {
|
default String openPointInTime(IndexCoordinates index, Duration keepAlive) {
|
||||||
return openPointInTime(index, keepAlive, false);
|
return openPointInTime(index, keepAlive, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Opens a point in time (pit) in Elasticsearch.
|
* Opens a point in time (pit) in Elasticsearch.
|
||||||
*
|
*
|
||||||
* @param index the index name(s) to use
|
* @param index the index name(s) to use
|
||||||
* @param keepAlive the duration the pit shoult be kept alive
|
* @param keepAlive the duration the pit shoult be kept alive
|
||||||
* @param ignoreUnavailable if {$literal true} the call will fail if any of the indices is missing or closed
|
* @param ignoreUnavailable if {$literal true} the call will fail if any of the indices is missing or closed
|
||||||
* @return the pit identifier
|
* @return the pit identifier
|
||||||
* @since 5.0
|
* @since 5.0
|
||||||
|
@ -29,16 +29,7 @@ import java.lang.Double;
|
|||||||
import java.lang.Integer;
|
import java.lang.Integer;
|
||||||
import java.lang.Long;
|
import java.lang.Long;
|
||||||
import java.lang.Object;
|
import java.lang.Object;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.UUID;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.IntStream;
|
import java.util.stream.IntStream;
|
||||||
|
|
||||||
@ -1784,8 +1775,7 @@ public abstract class ElasticsearchIntegrationTests {
|
|||||||
|
|
||||||
List<SearchHits<?>> searchHitsList = operations.multiSearch(queries,
|
List<SearchHits<?>> searchHitsList = operations.multiSearch(queries,
|
||||||
Lists.newArrayList(SampleEntity.class, Book.class),
|
Lists.newArrayList(SampleEntity.class, Book.class),
|
||||||
List.of(IndexCoordinates.of(indexNameProvider.indexName()),
|
List.of(IndexCoordinates.of(indexNameProvider.indexName()), IndexCoordinates.of(bookIndex.getIndexName())));
|
||||||
IndexCoordinates.of(bookIndex.getIndexName())));
|
|
||||||
|
|
||||||
bookIndexOperations.delete();
|
bookIndexOperations.delete();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user