61
61
import org .springframework .data .elasticsearch .core .cluster .ElasticsearchClusterOperations ;
62
62
import org .springframework .data .elasticsearch .core .convert .ElasticsearchConverter ;
63
63
import org .springframework .data .elasticsearch .core .document .DocumentAdapters ;
64
- import org .springframework .data .elasticsearch .core .reindex .ReindexRequest ;
65
64
import org .springframework .data .elasticsearch .core .document .SearchDocumentResponse ;
66
- import org .springframework .data .elasticsearch .core .reindex .ReindexResponse ;
67
65
import org .springframework .data .elasticsearch .core .mapping .IndexCoordinates ;
68
66
import org .springframework .data .elasticsearch .core .query .BulkOptions ;
69
67
import org .springframework .data .elasticsearch .core .query .ByQueryResponse ;
73
71
import org .springframework .data .elasticsearch .core .query .Query ;
74
72
import org .springframework .data .elasticsearch .core .query .UpdateQuery ;
75
73
import org .springframework .data .elasticsearch .core .query .UpdateResponse ;
74
+ import org .springframework .data .elasticsearch .core .reindex .ReindexRequest ;
75
+ import org .springframework .data .elasticsearch .core .reindex .ReindexResponse ;
76
76
import org .springframework .lang .Nullable ;
77
77
import org .springframework .util .Assert ;
78
78
@@ -265,7 +265,7 @@ public ByQueryResponse updateByQuery(UpdateQuery query, IndexCoordinates index)
265
265
Assert .notNull (query , "query must not be null" );
266
266
Assert .notNull (index , "index must not be null" );
267
267
268
- final UpdateByQueryRequest updateByQueryRequest = requestFactory .updateByQueryRequest (query , index );
268
+ UpdateByQueryRequest updateByQueryRequest = requestFactory .updateByQueryRequest (query , index );
269
269
270
270
if (query .getRefreshPolicy () == null && getRefreshPolicy () != null ) {
271
271
updateByQueryRequest .setRefresh (getRefreshPolicy () == RefreshPolicy .IMMEDIATE );
@@ -285,8 +285,8 @@ public ReindexResponse reindex(ReindexRequest postReindexRequest) {
285
285
286
286
Assert .notNull (postReindexRequest , "postReindexRequest must not be null" );
287
287
288
- final org .elasticsearch .index .reindex .ReindexRequest reindexRequest = requestFactory .reindexRequest (postReindexRequest );
289
- final BulkByScrollResponse bulkByScrollResponse = execute (
288
+ org .elasticsearch .index .reindex .ReindexRequest reindexRequest = requestFactory .reindexRequest (postReindexRequest );
289
+ BulkByScrollResponse bulkByScrollResponse = execute (
290
290
client -> client .reindex (reindexRequest , RequestOptions .DEFAULT ));
291
291
return ResponseConverter .reindexResponseOf (bulkByScrollResponse );
292
292
}
@@ -295,9 +295,8 @@ public ReindexResponse reindex(ReindexRequest postReindexRequest) {
295
295
public String submitReindex (ReindexRequest postReindexRequest ) {
296
296
Assert .notNull (postReindexRequest , "postReindexRequest must not be null" );
297
297
298
- final org .elasticsearch .index .reindex .ReindexRequest reindexRequest = requestFactory .reindexRequest (postReindexRequest );
299
- return execute (
300
- client -> client .submitReindexTask (reindexRequest , RequestOptions .DEFAULT ).getTask ());
298
+ org .elasticsearch .index .reindex .ReindexRequest reindexRequest = requestFactory .reindexRequest (postReindexRequest );
299
+ return execute (client -> client .submitReindexTask (reindexRequest , RequestOptions .DEFAULT ).getTask ());
301
300
}
302
301
303
302
public List <IndexedObjectInformation > doBulkOperation (List <?> queries , BulkOptions bulkOptions ,
0 commit comments