@@ -63,7 +63,7 @@ public final class BulkRequest<TSource> extends RequestBase implements ToJsonp {
63
63
private final JsonValue refresh ;
64
64
65
65
@ Nullable
66
- private final JsonValue routing ;
66
+ private final String routing ;
67
67
68
68
@ Nullable
69
69
private final JsonValue source ;
@@ -109,8 +109,7 @@ protected BulkRequest(Builder<TSource> builder) {
109
109
}
110
110
111
111
/**
112
- * A comma-separated list of index names to search; use <code>_all</code> or
113
- * empty string to perform the operation on all indices
112
+ * Default index for items which don't provide one
114
113
* <p>
115
114
* API name: {@code index}
116
115
*/
@@ -120,8 +119,7 @@ public String index() {
120
119
}
121
120
122
121
/**
123
- * A comma-separated list of document types to search; leave empty to perform
124
- * the operation on all types
122
+ * Default document type for items which don't provide one
125
123
* <p>
126
124
* API name: {@code type}
127
125
*/
@@ -131,6 +129,8 @@ public String type() {
131
129
}
132
130
133
131
/**
132
+ * The pipeline id to preprocess incoming documents with
133
+ * <p>
134
134
* API name: {@code pipeline}
135
135
*/
136
136
@ Nullable
@@ -139,6 +139,11 @@ public String pipeline() {
139
139
}
140
140
141
141
/**
142
+ * If <code>true</code> then refresh the affected shards to make this operation
143
+ * visible to search, if <code>wait_for</code> then wait for a refresh to make
144
+ * this operation visible to search, if <code>false</code> (the default) then do
145
+ * nothing with refreshes.
146
+ * <p>
142
147
* API name: {@code refresh}
143
148
*/
144
149
@ Nullable
@@ -147,14 +152,19 @@ public JsonValue refresh() {
147
152
}
148
153
149
154
/**
155
+ * Specific routing value
156
+ * <p>
150
157
* API name: {@code routing}
151
158
*/
152
159
@ Nullable
153
- public JsonValue routing () {
160
+ public String routing () {
154
161
return this .routing ;
155
162
}
156
163
157
164
/**
165
+ * True or false to return the _source field or not, or default list of fields
166
+ * to return, can be overridden on each sub-request
167
+ * <p>
158
168
* API name: {@code _source}
159
169
*/
160
170
@ Nullable
@@ -163,6 +173,9 @@ public JsonValue source() {
163
173
}
164
174
165
175
/**
176
+ * Default list of fields to exclude from the returned _source field, can be
177
+ * overridden on each sub-request
178
+ * <p>
166
179
* API name: {@code _source_excludes}
167
180
*/
168
181
@ Nullable
@@ -171,6 +184,9 @@ public List<String> sourceExcludes() {
171
184
}
172
185
173
186
/**
187
+ * Default list of fields to extract and return from the _source field, can be
188
+ * overridden on each sub-request
189
+ * <p>
174
190
* API name: {@code _source_includes}
175
191
*/
176
192
@ Nullable
@@ -179,6 +195,8 @@ public List<String> sourceIncludes() {
179
195
}
180
196
181
197
/**
198
+ * Explicit operation timeout
199
+ * <p>
182
200
* API name: {@code timeout}
183
201
*/
184
202
@ Nullable
@@ -187,6 +205,12 @@ public JsonValue timeout() {
187
205
}
188
206
189
207
/**
208
+ * Sets the number of shard copies that must be active before proceeding with
209
+ * the bulk operation. Defaults to 1, meaning the primary shard only. Set to
210
+ * <code>all</code> for all shard copies, otherwise set to any non-negative
211
+ * value less than or equal to the total number of copies for the shard (number
212
+ * of replicas + 1)
213
+ * <p>
190
214
* API name: {@code wait_for_active_shards}
191
215
*/
192
216
@ Nullable
@@ -195,6 +219,8 @@ public JsonValue waitForActiveShards() {
195
219
}
196
220
197
221
/**
222
+ * Sets require_alias for all incoming documents. Defaults to unset (false)
223
+ * <p>
198
224
* API name: {@code require_alias}
199
225
*/
200
226
@ Nullable
@@ -243,7 +269,7 @@ public static class Builder<TSource> implements ObjectBuilder<BulkRequest<TSourc
243
269
private JsonValue refresh ;
244
270
245
271
@ Nullable
246
- private JsonValue routing ;
272
+ private String routing ;
247
273
248
274
@ Nullable
249
275
private JsonValue source ;
@@ -269,8 +295,7 @@ public static class Builder<TSource> implements ObjectBuilder<BulkRequest<TSourc
269
295
private JsonpSerializer <TSource > tSourceSerializer ;
270
296
271
297
/**
272
- * A comma-separated list of index names to search; use <code>_all</code> or
273
- * empty string to perform the operation on all indices
298
+ * Default index for items which don't provide one
274
299
* <p>
275
300
* API name: {@code index}
276
301
*/
@@ -280,8 +305,7 @@ public Builder<TSource> index(@Nullable String value) {
280
305
}
281
306
282
307
/**
283
- * A comma-separated list of document types to search; leave empty to perform
284
- * the operation on all types
308
+ * Default document type for items which don't provide one
285
309
* <p>
286
310
* API name: {@code type}
287
311
*/
@@ -291,6 +315,8 @@ public Builder<TSource> type(@Nullable String value) {
291
315
}
292
316
293
317
/**
318
+ * The pipeline id to preprocess incoming documents with
319
+ * <p>
294
320
* API name: {@code pipeline}
295
321
*/
296
322
public Builder <TSource > pipeline (@ Nullable String value ) {
@@ -299,6 +325,11 @@ public Builder<TSource> pipeline(@Nullable String value) {
299
325
}
300
326
301
327
/**
328
+ * If <code>true</code> then refresh the affected shards to make this operation
329
+ * visible to search, if <code>wait_for</code> then wait for a refresh to make
330
+ * this operation visible to search, if <code>false</code> (the default) then do
331
+ * nothing with refreshes.
332
+ * <p>
302
333
* API name: {@code refresh}
303
334
*/
304
335
public Builder <TSource > refresh (@ Nullable JsonValue value ) {
@@ -307,14 +338,19 @@ public Builder<TSource> refresh(@Nullable JsonValue value) {
307
338
}
308
339
309
340
/**
341
+ * Specific routing value
342
+ * <p>
310
343
* API name: {@code routing}
311
344
*/
312
- public Builder <TSource > routing (@ Nullable JsonValue value ) {
345
+ public Builder <TSource > routing (@ Nullable String value ) {
313
346
this .routing = value ;
314
347
return this ;
315
348
}
316
349
317
350
/**
351
+ * True or false to return the _source field or not, or default list of fields
352
+ * to return, can be overridden on each sub-request
353
+ * <p>
318
354
* API name: {@code _source}
319
355
*/
320
356
public Builder <TSource > source (@ Nullable JsonValue value ) {
@@ -323,6 +359,9 @@ public Builder<TSource> source(@Nullable JsonValue value) {
323
359
}
324
360
325
361
/**
362
+ * Default list of fields to exclude from the returned _source field, can be
363
+ * overridden on each sub-request
364
+ * <p>
326
365
* API name: {@code _source_excludes}
327
366
*/
328
367
public Builder <TSource > sourceExcludes (@ Nullable List <String > value ) {
@@ -331,6 +370,9 @@ public Builder<TSource> sourceExcludes(@Nullable List<String> value) {
331
370
}
332
371
333
372
/**
373
+ * Default list of fields to exclude from the returned _source field, can be
374
+ * overridden on each sub-request
375
+ * <p>
334
376
* API name: {@code _source_excludes}
335
377
*/
336
378
public Builder <TSource > sourceExcludes (String ... value ) {
@@ -350,6 +392,9 @@ public Builder<TSource> addSourceExcludes(String value) {
350
392
}
351
393
352
394
/**
395
+ * Default list of fields to extract and return from the _source field, can be
396
+ * overridden on each sub-request
397
+ * <p>
353
398
* API name: {@code _source_includes}
354
399
*/
355
400
public Builder <TSource > sourceIncludes (@ Nullable List <String > value ) {
@@ -358,6 +403,9 @@ public Builder<TSource> sourceIncludes(@Nullable List<String> value) {
358
403
}
359
404
360
405
/**
406
+ * Default list of fields to extract and return from the _source field, can be
407
+ * overridden on each sub-request
408
+ * <p>
361
409
* API name: {@code _source_includes}
362
410
*/
363
411
public Builder <TSource > sourceIncludes (String ... value ) {
@@ -377,6 +425,8 @@ public Builder<TSource> addSourceIncludes(String value) {
377
425
}
378
426
379
427
/**
428
+ * Explicit operation timeout
429
+ * <p>
380
430
* API name: {@code timeout}
381
431
*/
382
432
public Builder <TSource > timeout (@ Nullable JsonValue value ) {
@@ -385,6 +435,12 @@ public Builder<TSource> timeout(@Nullable JsonValue value) {
385
435
}
386
436
387
437
/**
438
+ * Sets the number of shard copies that must be active before proceeding with
439
+ * the bulk operation. Defaults to 1, meaning the primary shard only. Set to
440
+ * <code>all</code> for all shard copies, otherwise set to any non-negative
441
+ * value less than or equal to the total number of copies for the shard (number
442
+ * of replicas + 1)
443
+ * <p>
388
444
* API name: {@code wait_for_active_shards}
389
445
*/
390
446
public Builder <TSource > waitForActiveShards (@ Nullable JsonValue value ) {
@@ -393,6 +449,8 @@ public Builder<TSource> waitForActiveShards(@Nullable JsonValue value) {
393
449
}
394
450
395
451
/**
452
+ * Sets require_alias for all incoming documents. Defaults to unset (false)
453
+ * <p>
396
454
* API name: {@code require_alias}
397
455
*/
398
456
public Builder <TSource > requireAlias (@ Nullable Boolean value ) {
@@ -529,7 +587,7 @@ protected static <TSource> void setupBulkRequestDeserializer(
529
587
params .put ("refresh" , request .refresh .toString ());
530
588
}
531
589
if (request .routing != null ) {
532
- params .put ("routing" , request .routing . toString () );
590
+ params .put ("routing" , request .routing );
533
591
}
534
592
if (request .source != null ) {
535
593
params .put ("_source" , request .source .toString ());
0 commit comments