|
| 1 | +[[dangling-index-import]] |
| 2 | +=== Import dangling index API |
| 3 | +++++ |
| 4 | +<titleabbrev>Import dangling index</titleabbrev> |
| 5 | +++++ |
| 6 | + |
| 7 | +Imports a dangling index. |
| 8 | + |
| 9 | +[[dangling-index-import-api-request]] |
| 10 | +==== {api-request-title} |
| 11 | + |
| 12 | +[source,console] |
| 13 | +-------------------------------------------------- |
| 14 | +POST /_dangling/<index-uuid>?accept_data_loss=true |
| 15 | +-------------------------------------------------- |
| 16 | +// TEST[skip:Difficult to set up] |
| 17 | + |
| 18 | +[[dangling-index-import-api-desc]] |
| 19 | +==== {api-description-title} |
| 20 | + |
| 21 | +include::{es-repo-dir}/indices/dangling-indices-list.asciidoc[tag=dangling-index-description] |
| 22 | + |
| 23 | +Import a single index into the cluster by referencing its UUID. Use the |
| 24 | +<<dangling-indices-list,List dangling indices API>> to locate the UUID of an index. |
| 25 | + |
| 26 | + |
| 27 | +[[dangling-index-import-api-path-params]] |
| 28 | +==== {api-path-parms-title} |
| 29 | + |
| 30 | +`<index-uuid>`:: |
| 31 | +(Required, string) |
| 32 | +UUID of the index to import, which you can find using the |
| 33 | +<<dangling-indices-list,List dangling indices API>>. |
| 34 | + |
| 35 | +[[dangling-index-import-api-query-params]] |
| 36 | +==== {api-query-parms-title} |
| 37 | + |
| 38 | +`accept_data_loss`:: |
| 39 | +(Required, boolean) |
| 40 | +This field must be set to `true` to import a dangling index. Because {es} |
| 41 | +cannot know where the dangling index data came from or determine which shard |
| 42 | +copies are fresh and which are stale, it cannot guarantee that the imported data |
| 43 | +represents the latest state of the index when it was last in the cluster. |
| 44 | + |
| 45 | +include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=timeout] |
| 46 | + |
| 47 | +[[dangling-index-import-api-example]] |
| 48 | +==== {api-examples-title} |
| 49 | + |
| 50 | +The following example shows how to import a dangling index: |
| 51 | + |
| 52 | +[source,console] |
| 53 | +-------------------------------------------------- |
| 54 | +POST /_dangling/zmM4e0JtBkeUjiHD-MihPQ?accept_data_loss=true |
| 55 | +-------------------------------------------------- |
| 56 | +// TEST[skip:Difficult to set up] |
| 57 | + |
| 58 | +The API returns following response: |
| 59 | + |
| 60 | +[source,console-result] |
| 61 | +-------------------------------------------------- |
| 62 | +{ |
| 63 | + "acknowledged" : true |
| 64 | +} |
| 65 | +-------------------------------------------------- |
0 commit comments