Skip to content

Commit cf9b106

Browse files
committed
Polishing
1 parent b0c2ce3 commit cf9b106

File tree

4 files changed

+15
-24
lines changed

4 files changed

+15
-24
lines changed

src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchTemplate.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ public List<SearchHits<?>> multiSearch(List<? extends Query> queries, List<Class
468468

469469
@Override
470470
public List<SearchHits<?>> multiSearch(List<? extends Query> queries, List<Class<?>> classes,
471-
List<IndexCoordinates> indexes) {
471+
List<IndexCoordinates> indexes) {
472472

473473
Assert.notNull(queries, "queries must not be null");
474474
Assert.notNull(classes, "classes must not be null");
@@ -652,9 +652,8 @@ protected List<IndexedObjectInformation> checkForBulkOperationFailure(BulkRespon
652652
failedDocuments);
653653
}
654654

655-
return bulkResponse.items().stream()
656-
.map(item -> new IndexedObjectInformation(item.id(), item.index(), item.seqNo(), item.primaryTerm(),
657-
item.version()))
655+
return bulkResponse.items().stream().map(
656+
item -> new IndexedObjectInformation(item.id(), item.index(), item.seqNo(), item.primaryTerm(), item.version()))
658657
.collect(Collectors.toList());
659658

660659
}

src/main/java/org/springframework/data/elasticsearch/client/erhlc/ElasticsearchRestTemplate.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,7 @@ protected List<IndexedObjectInformation> checkForBulkOperationFailure(BulkRespon
381381
response.getPrimaryTerm(), //
382382
response.getVersion());
383383
} else {
384-
return new IndexedObjectInformation(bulkItemResponse.getId(), bulkItemResponse.getIndex(), null, null,
385-
null);
384+
return new IndexedObjectInformation(bulkItemResponse.getId(), bulkItemResponse.getIndex(), null, null, null);
386385
}
387386

388387
}).collect(Collectors.toList());
@@ -561,7 +560,7 @@ public List<SearchHits<?>> multiSearch(List<? extends Query> queries, List<Class
561560

562561
@Override
563562
public List<SearchHits<?>> multiSearch(List<? extends Query> queries, List<Class<?>> classes,
564-
List<IndexCoordinates> indexes) {
563+
List<IndexCoordinates> indexes) {
565564

566565
Assert.notNull(queries, "queries must not be null");
567566
Assert.notNull(classes, "classes must not be null");

src/main/java/org/springframework/data/elasticsearch/core/SearchOperations.java

+8-5
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,10 @@ default <T> SearchHit<T> searchOne(Query query, Class<T> clazz, IndexCoordinates
140140
* @param classes the entity classes used for property mapping
141141
* @param indexes the indexes to run the queries against
142142
* @return list of SearchHits
143+
* @since 5.1
143144
*/
144-
List<SearchHits<?>> multiSearch(List<? extends Query> queries, List<Class<?>> classes, List<IndexCoordinates> indexes);
145+
List<SearchHits<?>> multiSearch(List<? extends Query> queries, List<Class<?>> classes,
146+
List<IndexCoordinates> indexes);
145147

146148
/**
147149
* Execute the criteria query against elasticsearch and return result as {@link SearchHits}
@@ -232,19 +234,20 @@ default <T> SearchHit<T> searchOne(Query query, Class<T> clazz, IndexCoordinates
232234
/**
233235
* Opens a point in time (pit) in Elasticsearch.
234236
*
235-
* @param index the index name(s) to use
236-
* @param keepAlive the duration the pit shoult be kept alive
237+
* @param index the index name(s) to use
238+
* @param keepAlive the duration the pit shoult be kept alive
237239
* @return the pit identifier
238240
* @since 5.0
239241
*/
240242
default String openPointInTime(IndexCoordinates index, Duration keepAlive) {
241243
return openPointInTime(index, keepAlive, false);
242244
}
245+
243246
/**
244247
* Opens a point in time (pit) in Elasticsearch.
245248
*
246-
* @param index the index name(s) to use
247-
* @param keepAlive the duration the pit shoult be kept alive
249+
* @param index the index name(s) to use
250+
* @param keepAlive the duration the pit shoult be kept alive
248251
* @param ignoreUnavailable if {$literal true} the call will fail if any of the indices is missing or closed
249252
* @return the pit identifier
250253
* @since 5.0

src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchIntegrationTests.java

+2-12
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,7 @@
2929
import java.lang.Integer;
3030
import java.lang.Long;
3131
import java.lang.Object;
32-
import java.util.ArrayList;
33-
import java.util.Arrays;
34-
import java.util.Collection;
35-
import java.util.Collections;
36-
import java.util.HashMap;
37-
import java.util.Iterator;
38-
import java.util.List;
39-
import java.util.Map;
40-
import java.util.Objects;
41-
import java.util.UUID;
32+
import java.util.*;
4233
import java.util.stream.Collectors;
4334
import java.util.stream.IntStream;
4435

@@ -1784,8 +1775,7 @@ public void shouldReturnDifferentEntityForMultiSearchWithMultipleIndexCoordinate
17841775

17851776
List<SearchHits<?>> searchHitsList = operations.multiSearch(queries,
17861777
Lists.newArrayList(SampleEntity.class, Book.class),
1787-
List.of(IndexCoordinates.of(indexNameProvider.indexName()),
1788-
IndexCoordinates.of(bookIndex.getIndexName())));
1778+
List.of(IndexCoordinates.of(indexNameProvider.indexName()), IndexCoordinates.of(bookIndex.getIndexName())));
17891779

17901780
bookIndexOperations.delete();
17911781

0 commit comments

Comments
 (0)