Skip to content

Commit

Permalink
Fix invalid BulkRequest construction for indexRandom() (opensearch-pr…
Browse files Browse the repository at this point in the history
…oject#11516)

Signed-off-by: Andriy Redko <[email protected]>
  • Loading branch information
reta authored Dec 7, 2023
1 parent 87b3011 commit 215fb22
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
import org.opensearch.action.search.ClearScrollResponse;
import org.opensearch.action.search.SearchResponse;
import org.opensearch.action.support.IndicesOptions;
import org.opensearch.action.support.WriteRequest;
import org.opensearch.client.AdminClient;
import org.opensearch.client.Client;
import org.opensearch.client.ClusterAdminClient;
Expand Down Expand Up @@ -1646,6 +1647,7 @@ public void indexRandom(boolean forceRefresh, boolean dummyDocuments, boolean ma
for (List<IndexRequestBuilder> segmented : partition) {
BulkRequestBuilder bulkBuilder = client().prepareBulk();
for (IndexRequestBuilder indexRequestBuilder : segmented) {
indexRequestBuilder.setRefreshPolicy(WriteRequest.RefreshPolicy.NONE);
bulkBuilder.add(indexRequestBuilder);
}
BulkResponse actionGet = bulkBuilder.execute().actionGet();
Expand Down

0 comments on commit 215fb22

Please sign in to comment.