0
# Index Management
1
2
APIs for creating, configuring, and managing indices including mappings, settings, and index lifecycle operations. OpenSearch provides comprehensive control over index structure, field definitions, analysis configuration, and operational maintenance.
3
4
## Capabilities
5
6
### Index CRUD Operations
7
8
Core operations for creating, reading, updating, and deleting indices.
9
10
```java { .api }
11
/**
12
* Request to create a new index with optional settings and mappings
13
*/
14
class CreateIndexRequest extends ActionRequest {
15
/**
16
* Create index request for specified index name
17
* @param index Name of the index to create
18
*/
19
CreateIndexRequest(String index);
20
21
/**
22
* Set index settings
23
* @param settings Index configuration settings
24
*/
25
CreateIndexRequest settings(Settings settings);
26
27
/**
28
* Set index settings from map
29
* @param source Settings as key-value pairs
30
*/
31
CreateIndexRequest settings(Map<String, Object> source);
32
33
/**
34
* Set index mapping for document structure
35
* @param source Mapping definition as JSON string
36
* @param xContentType Content type of the mapping source
37
*/
38
CreateIndexRequest mapping(String source, XContentType xContentType);
39
40
/**
41
* Set index mapping from map
42
* @param source Mapping definition as key-value pairs
43
*/
44
CreateIndexRequest mapping(Map<String, Object> source);
45
46
/**
47
* Add index alias
48
* @param alias Alias configuration
49
*/
50
CreateIndexRequest alias(Alias alias);
51
52
/**
53
* Set request timeout
54
* @param timeout Operation timeout
55
*/
56
CreateIndexRequest timeout(String timeout);
57
58
/**
59
* Set cluster manager node timeout
60
* @param clusterManagerNodeTimeout Timeout for cluster manager operations
61
*/
62
CreateIndexRequest clusterManagerNodeTimeout(String clusterManagerNodeTimeout);
63
64
/**
65
* Get index name
66
*/
67
String index();
68
69
/**
70
* Get configured settings
71
*/
72
Settings settings();
73
}
74
75
/**
76
* Response for index creation operations
77
*/
78
class CreateIndexResponse extends ActionResponse {
79
/**
80
* Check if index creation was acknowledged
81
*/
82
boolean isAcknowledged();
83
84
/**
85
* Check if shards were acknowledged before timeout
86
*/
87
boolean isShardsAcknowledged();
88
89
/**
90
* Get created index name
91
*/
92
String index();
93
}
94
95
/**
96
* Request to delete one or more indices
97
*/
98
class DeleteIndexRequest extends ActionRequest {
99
/**
100
* Create delete request for specified indices
101
* @param indices Index names to delete
102
*/
103
DeleteIndexRequest(String... indices);
104
105
/**
106
* Set request timeout
107
* @param timeout Operation timeout
108
*/
109
DeleteIndexRequest timeout(String timeout);
110
111
/**
112
* Set cluster manager node timeout
113
* @param clusterManagerNodeTimeout Timeout for cluster manager operations
114
*/
115
DeleteIndexRequest clusterManagerNodeTimeout(String clusterManagerNodeTimeout);
116
117
/**
118
* Get indices to delete
119
*/
120
String[] indices();
121
}
122
123
/**
124
* Request to get index information and metadata
125
*/
126
class GetIndexRequest extends ActionRequest {
127
/**
128
* Create get index request for specified indices
129
* @param indices Index names to retrieve information for
130
*/
131
GetIndexRequest(String... indices);
132
133
/**
134
* Include settings in response
135
* @param includeSettings Whether to include index settings
136
*/
137
GetIndexRequest includeSettings(boolean includeSettings);
138
139
/**
140
* Include mappings in response
141
* @param includeMappings Whether to include index mappings
142
*/
143
GetIndexRequest includeMappings(boolean includeMappings);
144
145
/**
146
* Include aliases in response
147
* @param includeAliases Whether to include index aliases
148
*/
149
GetIndexRequest includeAliases(boolean includeAliases);
150
151
/**
152
* Get target indices
153
*/
154
String[] indices();
155
}
156
157
/**
158
* Response containing index information and metadata
159
*/
160
class GetIndexResponse extends ActionResponse {
161
/**
162
* Get index names included in response
163
*/
164
String[] getIndices();
165
166
/**
167
* Get settings for specific index
168
* @param index Index name
169
*/
170
Settings getSettings(String index);
171
172
/**
173
* Get mappings for specific index
174
* @param index Index name
175
*/
176
MappingMetadata getMappings(String index);
177
178
/**
179
* Get aliases for specific index
180
* @param index Index name
181
*/
182
List<AliasMetadata> getAliases(String index);
183
184
/**
185
* Get all settings as map
186
*/
187
Map<String, Settings> getSettings();
188
189
/**
190
* Get all mappings as map
191
*/
192
Map<String, MappingMetadata> getMappings();
193
}
194
```
195
196
### Index Settings Management
197
198
APIs for configuring and updating index-level settings.
199
200
```java { .api }
201
/**
202
* Request to update index settings for existing indices
203
*/
204
class UpdateSettingsRequest extends ActionRequest {
205
/**
206
* Create update settings request for specified indices
207
* @param indices Index names to update settings for
208
*/
209
UpdateSettingsRequest(String... indices);
210
211
/**
212
* Set new settings to apply
213
* @param settings Settings configuration to update
214
*/
215
UpdateSettingsRequest settings(Settings settings);
216
217
/**
218
* Set settings from map
219
* @param source Settings as key-value pairs
220
*/
221
UpdateSettingsRequest settings(Map<String, Object> source);
222
223
/**
224
* Set settings from JSON string
225
* @param source Settings as JSON string
226
* @param xContentType Content type of the settings source
227
*/
228
UpdateSettingsRequest settings(String source, XContentType xContentType);
229
230
/**
231
* Set request timeout
232
* @param timeout Operation timeout
233
*/
234
UpdateSettingsRequest timeout(String timeout);
235
236
/**
237
* Get target indices
238
*/
239
String[] indices();
240
241
/**
242
* Get settings to update
243
*/
244
Settings settings();
245
}
246
247
/**
248
* Request to retrieve current index settings
249
*/
250
class GetSettingsRequest extends ActionRequest {
251
/**
252
* Create get settings request for specified indices
253
* @param indices Index names to get settings for
254
*/
255
GetSettingsRequest(String... indices);
256
257
/**
258
* Set specific setting names to retrieve
259
* @param names Setting names to include in response
260
*/
261
GetSettingsRequest names(String... names);
262
263
/**
264
* Include default settings in response
265
* @param includeDefaults Whether to include default settings
266
*/
267
GetSettingsRequest includeDefaults(boolean includeDefaults);
268
269
/**
270
* Get target indices
271
*/
272
String[] indices();
273
274
/**
275
* Get setting names to retrieve
276
*/
277
String[] names();
278
}
279
280
/**
281
* Response containing index settings information
282
*/
283
class GetSettingsResponse extends ActionResponse {
284
/**
285
* Get settings for specific index
286
* @param index Index name
287
*/
288
Settings getIndexSettings(String index);
289
290
/**
291
* Get all index settings as map
292
*/
293
Map<String, Settings> getIndexToSettings();
294
295
/**
296
* Get setting value for specific index and setting name
297
* @param index Index name
298
* @param setting Setting name
299
*/
300
String getSetting(String index, String setting);
301
}
302
```
303
304
### Mapping Management
305
306
APIs for defining and managing field mappings and document structure.
307
308
```java { .api }
309
/**
310
* Request to put or update index mapping definitions
311
*/
312
class PutMappingRequest extends ActionRequest {
313
/**
314
* Create put mapping request for specified indices
315
* @param indices Index names to apply mapping to
316
*/
317
PutMappingRequest(String... indices);
318
319
/**
320
* Set mapping source from JSON string
321
* @param source Mapping definition as JSON
322
* @param xContentType Content type of the mapping source
323
*/
324
PutMappingRequest source(String source, XContentType xContentType);
325
326
/**
327
* Set mapping source from map
328
* @param source Mapping definition as key-value pairs
329
*/
330
PutMappingRequest source(Map<String, Object> source);
331
332
/**
333
* Set request timeout
334
* @param timeout Operation timeout
335
*/
336
PutMappingRequest timeout(String timeout);
337
338
/**
339
* Set cluster manager node timeout
340
* @param clusterManagerNodeTimeout Timeout for cluster manager operations
341
*/
342
PutMappingRequest clusterManagerNodeTimeout(String clusterManagerNodeTimeout);
343
344
/**
345
* Get target indices
346
*/
347
String[] indices();
348
349
/**
350
* Get mapping source
351
*/
352
String source();
353
}
354
355
/**
356
* Request to retrieve index mapping definitions
357
*/
358
class GetMappingsRequest extends ActionRequest {
359
/**
360
* Create get mappings request for specified indices
361
* @param indices Index names to get mappings for
362
*/
363
GetMappingsRequest(String... indices);
364
365
/**
366
* Set local flag for cluster state retrieval
367
* @param local Whether to retrieve from local cluster state
368
*/
369
GetMappingsRequest local(boolean local);
370
371
/**
372
* Get target indices
373
*/
374
String[] indices();
375
}
376
377
/**
378
* Response containing index mapping definitions
379
*/
380
class GetMappingsResponse extends ActionResponse {
381
/**
382
* Get all mappings as map
383
*/
384
Map<String, MappingMetadata> mappings();
385
386
/**
387
* Get mapping for specific index
388
* @param index Index name
389
*/
390
MappingMetadata getMappings(String index);
391
}
392
393
/**
394
* Mapping metadata container for field definitions and properties
395
*/
396
class MappingMetadata implements Streamable {
397
/**
398
* Get mapping type (usually "_doc")
399
*/
400
String type();
401
402
/**
403
* Get mapping source as map
404
*/
405
Map<String, Object> sourceAsMap();
406
407
/**
408
* Get mapping source as string
409
*/
410
String source();
411
412
/**
413
* Get routing configuration
414
*/
415
Routing routing();
416
}
417
```
418
419
### Index Operations
420
421
Lifecycle operations for managing index state and maintenance.
422
423
```java { .api }
424
/**
425
* Request to open closed indices
426
*/
427
class OpenIndexRequest extends ActionRequest {
428
/**
429
* Create open index request for specified indices
430
* @param indices Index names to open
431
*/
432
OpenIndexRequest(String... indices);
433
434
/**
435
* Set request timeout
436
* @param timeout Operation timeout
437
*/
438
OpenIndexRequest timeout(String timeout);
439
440
/**
441
* Set cluster manager node timeout
442
* @param clusterManagerNodeTimeout Timeout for cluster manager operations
443
*/
444
OpenIndexRequest clusterManagerNodeTimeout(String clusterManagerNodeTimeout);
445
446
/**
447
* Wait for active shards before returning
448
* @param waitForActiveShards Number of active shards to wait for
449
*/
450
OpenIndexRequest waitForActiveShards(ActiveShardCount waitForActiveShards);
451
452
/**
453
* Get target indices
454
*/
455
String[] indices();
456
}
457
458
/**
459
* Request to close open indices
460
*/
461
class CloseIndexRequest extends ActionRequest {
462
/**
463
* Create close index request for specified indices
464
* @param indices Index names to close
465
*/
466
CloseIndexRequest(String... indices);
467
468
/**
469
* Set request timeout
470
* @param timeout Operation timeout
471
*/
472
CloseIndexRequest timeout(String timeout);
473
474
/**
475
* Set cluster manager node timeout
476
* @param clusterManagerNodeTimeout Timeout for cluster manager operations
477
*/
478
CloseIndexRequest clusterManagerNodeTimeout(String clusterManagerNodeTimeout);
479
480
/**
481
* Get target indices
482
*/
483
String[] indices();
484
}
485
486
/**
487
* Request to refresh indices and make recent changes searchable
488
*/
489
class RefreshRequest extends ActionRequest {
490
/**
491
* Create refresh request for specified indices
492
* @param indices Index names to refresh (empty for all)
493
*/
494
RefreshRequest(String... indices);
495
496
/**
497
* Get target indices
498
*/
499
String[] indices();
500
}
501
502
/**
503
* Response for refresh operations
504
*/
505
class RefreshResponse extends ActionResponse {
506
/**
507
* Get total number of shards
508
*/
509
int getTotalShards();
510
511
/**
512
* Get number of successful shards
513
*/
514
int getSuccessfulShards();
515
516
/**
517
* Get number of failed shards
518
*/
519
int getFailedShards();
520
521
/**
522
* Get shard failures if any
523
*/
524
DefaultShardOperationFailedException[] getShardFailures();
525
}
526
527
/**
528
* Request to flush indices and commit changes to storage
529
*/
530
class FlushRequest extends ActionRequest {
531
/**
532
* Create flush request for specified indices
533
* @param indices Index names to flush (empty for all)
534
*/
535
FlushRequest(String... indices);
536
537
/**
538
* Set whether to wait for ongoing operations
539
* @param waitIfOngoing Whether to wait for ongoing operations to complete
540
*/
541
FlushRequest waitIfOngoing(boolean waitIfOngoing);
542
543
/**
544
* Force flush even if not necessary
545
* @param force Whether to force flush
546
*/
547
FlushRequest force(boolean force);
548
549
/**
550
* Get target indices
551
*/
552
String[] indices();
553
}
554
555
/**
556
* Request to force merge index segments for optimization
557
*/
558
class ForceMergeRequest extends ActionRequest {
559
/**
560
* Create force merge request for specified indices
561
* @param indices Index names to force merge (empty for all)
562
*/
563
ForceMergeRequest(String... indices);
564
565
/**
566
* Set maximum number of segments to merge down to
567
* @param maxNumSegments Target number of segments per shard
568
*/
569
ForceMergeRequest maxNumSegments(int maxNumSegments);
570
571
/**
572
* Set whether to only expunge deleted documents
573
* @param onlyExpungeDeletes Whether to only expunge deletes
574
*/
575
ForceMergeRequest onlyExpungeDeletes(boolean onlyExpungeDeletes);
576
577
/**
578
* Set whether to flush after merge
579
* @param flush Whether to flush after merge
580
*/
581
ForceMergeRequest flush(boolean flush);
582
583
/**
584
* Get target indices
585
*/
586
String[] indices();
587
}
588
```
589
590
### Index Aliases
591
592
APIs for managing index aliases and multi-index operations.
593
594
```java { .api }
595
/**
596
* Index alias configuration for alternative index names
597
*/
598
class Alias implements Streamable {
599
/**
600
* Create alias with specified name
601
* @param name Alias name
602
*/
603
Alias(String name);
604
605
/**
606
* Set routing value for alias operations
607
* @param routing Routing value for shard selection
608
*/
609
Alias routing(String routing);
610
611
/**
612
* Set search routing value
613
* @param searchRouting Routing value for search operations
614
*/
615
Alias searchRouting(String searchRouting);
616
617
/**
618
* Set index routing value
619
* @param indexRouting Routing value for index operations
620
*/
621
Alias indexRouting(String indexRouting);
622
623
/**
624
* Set filter query for alias
625
* @param filter Filter query to apply to alias operations
626
*/
627
Alias filter(QueryBuilder filter);
628
629
/**
630
* Get alias name
631
*/
632
String name();
633
634
/**
635
* Get routing configuration
636
*/
637
String routing();
638
}
639
640
/**
641
* Request to manage index aliases (add, remove, modify)
642
*/
643
class IndicesAliasesRequest extends ActionRequest {
644
/**
645
* Create indices aliases request
646
*/
647
IndicesAliasesRequest();
648
649
/**
650
* Add alias action to request
651
* @param aliasAction Action to perform (add, remove, remove_index)
652
*/
653
IndicesAliasesRequest addAliasAction(AliasActions aliasAction);
654
655
/**
656
* Set request timeout
657
* @param timeout Operation timeout
658
*/
659
IndicesAliasesRequest timeout(String timeout);
660
661
/**
662
* Get list of alias actions
663
*/
664
List<AliasActions> getAliasActions();
665
666
/**
667
* Individual alias action (add, remove, remove_index)
668
*/
669
abstract static class AliasActions implements Streamable {
670
/**
671
* Create add alias action
672
*/
673
static AliasActions add();
674
675
/**
676
* Create remove alias action
677
*/
678
static AliasActions remove();
679
680
/**
681
* Create remove index action
682
*/
683
static AliasActions removeIndex();
684
685
/**
686
* Set target indices
687
* @param indices Index names
688
*/
689
AliasActions indices(String... indices);
690
691
/**
692
* Set alias name
693
* @param alias Alias name
694
*/
695
AliasActions alias(String alias);
696
697
/**
698
* Set routing value
699
* @param routing Routing value
700
*/
701
AliasActions routing(String routing);
702
703
/**
704
* Set filter query
705
* @param filter Filter query
706
*/
707
AliasActions filter(QueryBuilder filter);
708
}
709
}
710
```
711
712
## Usage Examples
713
714
### Creating Indices with Settings and Mappings
715
716
```java
717
import org.opensearch.action.admin.indices.create.CreateIndexRequest;
718
import org.opensearch.action.admin.indices.create.CreateIndexResponse;
719
import org.opensearch.common.settings.Settings;
720
import org.opensearch.common.xcontent.XContentType;
721
722
// Create index with custom settings
723
CreateIndexRequest request = new CreateIndexRequest("products");
724
725
// Configure index settings
726
Settings settings = Settings.builder()
727
.put("index.number_of_shards", 3)
728
.put("index.number_of_replicas", 1)
729
.put("index.refresh_interval", "1s")
730
.put("analysis.analyzer.custom_analyzer.type", "custom")
731
.put("analysis.analyzer.custom_analyzer.tokenizer", "standard")
732
.put("analysis.analyzer.custom_analyzer.filter", new String[]{"lowercase", "stop"})
733
.build();
734
735
request.settings(settings);
736
737
// Define field mappings
738
String mapping = """
739
{
740
"properties": {
741
"name": {
742
"type": "text",
743
"analyzer": "custom_analyzer"
744
},
745
"description": {
746
"type": "text",
747
"analyzer": "standard"
748
},
749
"price": {
750
"type": "double"
751
},
752
"category": {
753
"type": "keyword"
754
},
755
"created_date": {
756
"type": "date",
757
"format": "yyyy-MM-dd HH:mm:ss"
758
},
759
"tags": {
760
"type": "keyword"
761
},
762
"location": {
763
"type": "geo_point"
764
}
765
}
766
}
767
""";
768
769
request.mapping(mapping, XContentType.JSON);
770
771
// Add index alias
772
request.alias(new Alias("products_current"));
773
774
CreateIndexResponse response = client.admin().indices().create(request);
775
System.out.println("Index created: " + response.isAcknowledged());
776
```
777
778
### Updating Index Settings
779
780
```java
781
import org.opensearch.action.admin.indices.settings.put.UpdateSettingsRequest;
782
import org.opensearch.action.support.master.AcknowledgedResponse;
783
784
// Update dynamic settings for existing index
785
UpdateSettingsRequest updateRequest = new UpdateSettingsRequest("products");
786
787
Settings updatedSettings = Settings.builder()
788
.put("index.refresh_interval", "5s")
789
.put("index.max_result_window", 20000)
790
.put("index.number_of_replicas", 2)
791
.build();
792
793
updateRequest.settings(updatedSettings);
794
795
AcknowledgedResponse updateResponse = client.admin().indices().updateSettings(updateRequest);
796
System.out.println("Settings updated: " + updateResponse.isAcknowledged());
797
```
798
799
### Managing Index Mappings
800
801
```java
802
import org.opensearch.action.admin.indices.mapping.put.PutMappingRequest;
803
import org.opensearch.action.admin.indices.mapping.get.GetMappingsRequest;
804
import org.opensearch.action.admin.indices.mapping.get.GetMappingsResponse;
805
806
// Add new fields to existing mapping
807
PutMappingRequest putMappingRequest = new PutMappingRequest("products");
808
809
String newMapping = """
810
{
811
"properties": {
812
"rating": {
813
"type": "float"
814
},
815
"reviews": {
816
"type": "nested",
817
"properties": {
818
"user": {"type": "keyword"},
819
"comment": {"type": "text"},
820
"score": {"type": "integer"}
821
}
822
}
823
}
824
}
825
""";
826
827
putMappingRequest.source(newMapping, XContentType.JSON);
828
829
AcknowledgedResponse putMappingResponse = client.admin().indices().putMapping(putMappingRequest);
830
System.out.println("Mapping updated: " + putMappingResponse.isAcknowledged());
831
832
// Retrieve current mappings
833
GetMappingsRequest getMappingsRequest = new GetMappingsRequest("products");
834
GetMappingsResponse getMappingsResponse = client.admin().indices().getMappings(getMappingsRequest);
835
836
MappingMetadata mappingMetadata = getMappingsResponse.getMappings().get("products");
837
System.out.println("Current mapping: " + mappingMetadata.source());
838
```
839
840
### Index Lifecycle Operations
841
842
```java
843
import org.opensearch.action.admin.indices.close.CloseIndexRequest;
844
import org.opensearch.action.admin.indices.open.OpenIndexRequest;
845
import org.opensearch.action.admin.indices.refresh.RefreshRequest;
846
import org.opensearch.action.admin.indices.forcemerge.ForceMergeRequest;
847
848
// Close index to save resources
849
CloseIndexRequest closeRequest = new CloseIndexRequest("old_products");
850
AcknowledgedResponse closeResponse = client.admin().indices().close(closeRequest);
851
System.out.println("Index closed: " + closeResponse.isAcknowledged());
852
853
// Reopen index when needed
854
OpenIndexRequest openRequest = new OpenIndexRequest("old_products");
855
AcknowledgedResponse openResponse = client.admin().indices().open(openRequest);
856
System.out.println("Index opened: " + openResponse.isAcknowledged());
857
858
// Refresh index to make recent changes searchable
859
RefreshRequest refreshRequest = new RefreshRequest("products");
860
RefreshResponse refreshResponse = client.admin().indices().refresh(refreshRequest);
861
System.out.println("Refresh successful shards: " + refreshResponse.getSuccessfulShards());
862
863
// Force merge to optimize storage
864
ForceMergeRequest forceMergeRequest = new ForceMergeRequest("products");
865
forceMergeRequest.maxNumSegments(1); // Merge to single segment per shard
866
forceMergeRequest.onlyExpungeDeletes(false);
867
forceMergeRequest.flush(true);
868
869
ForceMergeResponse forceMergeResponse = client.admin().indices().forceMerge(forceMergeRequest);
870
System.out.println("Force merge completed");
871
```
872
873
### Managing Index Aliases
874
875
```java
876
import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest;
877
import org.opensearch.action.admin.indices.alias.get.GetAliasesRequest;
878
import org.opensearch.index.query.QueryBuilders;
879
880
// Create alias management request
881
IndicesAliasesRequest aliasRequest = new IndicesAliasesRequest();
882
883
// Add new alias with filter
884
aliasRequest.addAliasAction(
885
IndicesAliasesRequest.AliasActions.add()
886
.indices("products_2024_*")
887
.alias("products_current")
888
.filter(QueryBuilders.termQuery("status", "active"))
889
);
890
891
// Remove old alias
892
aliasRequest.addAliasAction(
893
IndicesAliasesRequest.AliasActions.remove()
894
.indices("products_2023_*")
895
.alias("products_current")
896
);
897
898
// Add routing alias
899
aliasRequest.addAliasAction(
900
IndicesAliasesRequest.AliasActions.add()
901
.indices("products_2024_01")
902
.alias("products_jan")
903
.routing("jan")
904
);
905
906
AcknowledgedResponse aliasResponse = client.admin().indices().updateAliases(aliasRequest);
907
System.out.println("Aliases updated: " + aliasResponse.isAcknowledged());
908
```
909
910
## Types
911
912
```java { .api }
913
/**
914
* Index metadata container with settings, mappings, and aliases
915
*/
916
class IndexMetadata implements Streamable {
917
/**
918
* Get index name
919
*/
920
String getIndex();
921
922
/**
923
* Get index UUID
924
*/
925
String getIndexUUID();
926
927
/**
928
* Get index settings
929
*/
930
Settings getSettings();
931
932
/**
933
* Get index mappings
934
*/
935
Map<String, MappingMetadata> getMappings();
936
937
/**
938
* Get index aliases
939
*/
940
Map<String, AliasMetadata> getAliases();
941
942
/**
943
* Get index state
944
*/
945
State getState();
946
947
/**
948
* Index state enumeration
949
*/
950
enum State {
951
OPEN, CLOSE
952
}
953
}
954
955
/**
956
* Alias metadata containing alias configuration
957
*/
958
class AliasMetadata implements Streamable {
959
/**
960
* Get alias name
961
*/
962
String alias();
963
964
/**
965
* Get filter query
966
*/
967
CompressedXContent filter();
968
969
/**
970
* Get index routing
971
*/
972
String indexRouting();
973
974
/**
975
* Get search routing
976
*/
977
String searchRouting();
978
}
979
980
/**
981
* Active shard count configuration for index operations
982
*/
983
class ActiveShardCount implements Streamable {
984
/**
985
* Wait for all shards to be active
986
*/
987
static final ActiveShardCount ALL;
988
989
/**
990
* Don't wait for any shards
991
*/
992
static final ActiveShardCount NONE;
993
994
/**
995
* Wait for default number of shards (1)
996
*/
997
static final ActiveShardCount DEFAULT;
998
999
/**
1000
* Create active shard count for specific number
1001
* @param count Number of shards to wait for
1002
*/
1003
static ActiveShardCount from(int count);
1004
}
1005
1006
/**
1007
* Content type enumeration for request bodies
1008
*/
1009
enum XContentType {
1010
/**
1011
* JavaScript Object Notation
1012
*/
1013
JSON,
1014
1015
/**
1016
* YAML Ain't Markup Language
1017
*/
1018
YAML,
1019
1020
/**
1021
* Concise Binary Object Representation
1022
*/
1023
CBOR,
1024
1025
/**
1026
* Extensible Markup Language
1027
*/
1028
XML
1029
}
1030
```