diff --git a/core/src/main/java/org/fao/geonet/kernel/search/submission/BatchingIndexSubmittor.java b/core/src/main/java/org/fao/geonet/kernel/search/submission/BatchingIndexSubmittor.java index 559b405d47d..36a14510019 100644 --- a/core/src/main/java/org/fao/geonet/kernel/search/submission/BatchingIndexSubmittor.java +++ b/core/src/main/java/org/fao/geonet/kernel/search/submission/BatchingIndexSubmittor.java @@ -48,11 +48,11 @@ public void run() { private void sendDocumentsToIndex(Map toIndex) { EsRestClient restClient = searchManager.getClient(); - BulkRequest bulkRequest = restClient.buildBulkRequest(searchManager.getDefaultIndex(), listOfDocumentsToIndex); + BulkRequest bulkRequest = restClient.buildBulkRequest(searchManager.getDefaultIndex(), toIndex); CompletableFuture currentIndexFuture = restClient.getAsyncClient().bulk(bulkRequest) .thenAcceptAsync(bulkItemResponses -> { try { - searchManager.handleIndexResponse(bulkItemResponses, listOfDocumentsToIndex); + searchManager.handleIndexResponse(bulkItemResponses, toIndex); } catch (IOException e) { throw new UncheckedIOException(e); }