|
| 1 | +[[java-rest-high-open-index]] |
| 2 | +=== Open Index API |
| 3 | + |
| 4 | +[[java-rest-high-open-index-request]] |
| 5 | +==== Open Index Request |
| 6 | + |
| 7 | +An `OpenIndexRequest` requires an `index` argument: |
| 8 | + |
| 9 | +["source","java",subs="attributes,callouts,macros"] |
| 10 | +-------------------------------------------------- |
| 11 | +include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[open-index-request] |
| 12 | +-------------------------------------------------- |
| 13 | +<1> The index to open |
| 14 | + |
| 15 | +==== Optional arguments |
| 16 | +The following arguments can optionally be provided: |
| 17 | + |
| 18 | +["source","java",subs="attributes,callouts,macros"] |
| 19 | +-------------------------------------------------- |
| 20 | +include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[open-index-request-timeout] |
| 21 | +-------------------------------------------------- |
| 22 | +<1> Timeout to wait for the all the nodes to acknowledge the index is opened |
| 23 | +as a `TimeValue` |
| 24 | +<2> Timeout to wait for the all the nodes to acknowledge the index is opened |
| 25 | +as a `String` |
| 26 | + |
| 27 | +["source","java",subs="attributes,callouts,macros"] |
| 28 | +-------------------------------------------------- |
| 29 | +include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[open-index-request-masterTimeout] |
| 30 | +-------------------------------------------------- |
| 31 | +<1> Timeout to connect to the master node as a `TimeValue` |
| 32 | +<2> Timeout to connect to the master node as a `String` |
| 33 | + |
| 34 | +["source","java",subs="attributes,callouts,macros"] |
| 35 | +-------------------------------------------------- |
| 36 | +include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[open-index-request-waitForActiveShards] |
| 37 | +-------------------------------------------------- |
| 38 | +<1> The number of active shard copies to wait for before proceeding with the |
| 39 | +operation, as an `int`. |
| 40 | +<2> The number of active shard copies to wait for before proceeding with the |
| 41 | +operation, as an `ActiveShardCount`. |
| 42 | + |
| 43 | +["source","java",subs="attributes,callouts,macros"] |
| 44 | +-------------------------------------------------- |
| 45 | +include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[open-index-request-indicesOptions] |
| 46 | +-------------------------------------------------- |
| 47 | +<1> Setting `IndicesOptions` controls how unavailable indices are resolved and |
| 48 | +how wildcard expressions are expanded |
| 49 | + |
| 50 | +[[java-rest-high-open-index-sync]] |
| 51 | +==== Synchronous Execution |
| 52 | + |
| 53 | +["source","java",subs="attributes,callouts,macros"] |
| 54 | +-------------------------------------------------- |
| 55 | +include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[open-index-execute] |
| 56 | +-------------------------------------------------- |
| 57 | + |
| 58 | +[[java-rest-high-open-index-async]] |
| 59 | +==== Asynchronous Execution |
| 60 | + |
| 61 | +["source","java",subs="attributes,callouts,macros"] |
| 62 | +-------------------------------------------------- |
| 63 | +include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[open-index-execute-async] |
| 64 | +-------------------------------------------------- |
| 65 | +<1> Called when the execution is successfully completed. The response is |
| 66 | +provided as an argument |
| 67 | +<2> Called in case of failure. The raised exception is provided as an argument |
| 68 | + |
| 69 | +[[java-rest-high-open-index-response]] |
| 70 | +==== Open Index Response |
| 71 | + |
| 72 | +The returned `OpenIndexResponse` allows to retrieve information about the |
| 73 | +executed operation as follows: |
| 74 | + |
| 75 | +["source","java",subs="attributes,callouts,macros"] |
| 76 | +-------------------------------------------------- |
| 77 | +include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[open-index-response] |
| 78 | +-------------------------------------------------- |
| 79 | +<1> Indicates whether all of the nodes have acknowledged the request |
| 80 | +<2> Indicates whether the requisite number of shard copies were started for |
| 81 | +each shard in the index before timing out |
0 commit comments