deleteindex.asciidoc 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. [[java-rest-high-delete-index]]
  2. === Delete Index API
  3. [[java-rest-high-delete-index-request]]
  4. ==== Delete Index Request
  5. A `DeleteIndexRequest` requires an `index` argument:
  6. ["source","java",subs="attributes,callouts,macros"]
  7. --------------------------------------------------
  8. include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[delete-index-request]
  9. --------------------------------------------------
  10. <1> Index
  11. ==== Optional arguments
  12. The following arguments can optionally be provided:
  13. ["source","java",subs="attributes,callouts,macros"]
  14. --------------------------------------------------
  15. include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[delete-index-request-timeout]
  16. --------------------------------------------------
  17. <1> Timeout to wait for the all the nodes to acknowledge the index deletion as a `TimeValue`
  18. <2> Timeout to wait for the all the nodes to acknowledge the index deletion as a `String`
  19. ["source","java",subs="attributes,callouts,macros"]
  20. --------------------------------------------------
  21. include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[delete-index-request-masterTimeout]
  22. --------------------------------------------------
  23. <1> Timeout to connect to the master node as a `TimeValue`
  24. <2> Timeout to connect to the master node as a `String`
  25. ["source","java",subs="attributes,callouts,macros"]
  26. --------------------------------------------------
  27. include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[delete-index-request-indicesOptions]
  28. --------------------------------------------------
  29. <1> Setting `IndicesOptions` controls how unavailable indices are resolved and
  30. how wildcard expressions are expanded
  31. [[java-rest-high-delete-index-sync]]
  32. ==== Synchronous Execution
  33. ["source","java",subs="attributes,callouts,macros"]
  34. --------------------------------------------------
  35. include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[delete-index-execute]
  36. --------------------------------------------------
  37. [[java-rest-high-delete-index-async]]
  38. ==== Asynchronous Execution
  39. ["source","java",subs="attributes,callouts,macros"]
  40. --------------------------------------------------
  41. include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[delete-index-execute-async]
  42. --------------------------------------------------
  43. <1> Called when the execution is successfully completed. The response is
  44. provided as an argument
  45. <2> Called in case of failure. The raised exception is provided as an argument
  46. [[java-rest-high-delete-index-response]]
  47. ==== Delete Index Response
  48. The returned `DeleteIndexResponse` allows to retrieve information about the executed
  49. operation as follows:
  50. ["source","java",subs="attributes,callouts,macros"]
  51. --------------------------------------------------
  52. include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[delete-index-response]
  53. --------------------------------------------------
  54. <1> Indicates whether all of the nodes have acknowledged the request or not
  55. If the index was not found, an `ElasticsearchException` will be thrown:
  56. ["source","java",subs="attributes,callouts,macros"]
  57. --------------------------------------------------
  58. include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[delete-index-notfound]
  59. --------------------------------------------------
  60. <1> Do something if the index to be deleted was not found