segments.asciidoc 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. [[cat-segments]]
  2. === cat segments API
  3. ++++
  4. <titleabbrev>cat segments</titleabbrev>
  5. ++++
  6. Returns low-level information about the https://lucene.apache.org/core/[Lucene]
  7. segments in index shards, similar to the <<indices-segments, indices segments>>
  8. API.
  9. For data streams, the API returns information about the stream's backing
  10. indices.
  11. [[cat-segments-api-request]]
  12. ==== {api-request-title}
  13. `GET /_cat/segments/<target>`
  14. `GET /_cat/segments`
  15. [[cat-segments-path-params]]
  16. ==== {api-path-parms-title}
  17. `<target>`::
  18. (Optional, string)
  19. Comma-separated list of data streams, indices, and index aliases used to limit
  20. the request. Wildcard expressions (`*`) are supported.
  21. +
  22. To target all data streams and indices in a cluster, omit this parameter or use
  23. `_all` or `*`.
  24. [[cat-segments-query-params]]
  25. ==== {api-query-parms-title}
  26. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=bytes]
  27. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=http-format]
  28. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=cat-h]
  29. +
  30. --
  31. If you do not specify which columns to include, the API returns the default
  32. columns in the order listed below. If you explicitly specify one or more
  33. columns, it only returns the specified columns.
  34. Valid columns are:
  35. `index`, `i`, `idx`::
  36. (Default) Name of the index.
  37. `shard`, `s`, `sh`::
  38. (Default) Name of the shard.
  39. `prirep`, `p`, `pr`, `primaryOrReplica`::
  40. (Default) Shard type. Returned values are `primary` or `replica`.
  41. `ip`::
  42. (Default) IP address of the segment's shard, such as `127.0.1.1`.
  43. `segment`::
  44. (Default)
  45. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=segment]
  46. `generation`::
  47. (Default)
  48. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=generation]
  49. `docs.count`::
  50. (Default)
  51. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=docs-count]
  52. `docs.deleted`::
  53. (Default)
  54. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=docs-deleted]
  55. `size`::
  56. (Default)
  57. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=segment-size]
  58. `size.memory`::
  59. (Default)
  60. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=memory]
  61. `committed`::
  62. (Default)
  63. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=committed]
  64. `searchable`::
  65. (Default)
  66. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=segment-search]
  67. `version`::
  68. (Default)
  69. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=segment-version]
  70. `compound`::
  71. (Default) If `true`, the segment is stored in a compound file. This means Lucene
  72. merged all files from the segment in a single file to save file descriptors.
  73. `id`::
  74. ID of the node, such as `k0zy`.
  75. --
  76. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=help]
  77. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=cat-s]
  78. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=cat-v]
  79. [[cat-segments-api-example]]
  80. ==== {api-examples-title}
  81. [source,console]
  82. --------------------------------------------------
  83. GET /_cat/segments?v=true
  84. --------------------------------------------------
  85. // TEST[s/^/PUT \/test\/_doc\/1?refresh\n{"test":"test"}\nPUT \/test1\/_doc\/1?refresh\n{"test":"test"}\n/]
  86. The API returns the following response:
  87. ["source","txt",subs="attributes,callouts"]
  88. --------------------------------------------------
  89. index shard prirep ip segment generation docs.count docs.deleted size size.memory committed searchable version compound
  90. test 0 p 127.0.0.1 _0 0 1 0 3kb 2042 false true {lucene_version} true
  91. test1 0 p 127.0.0.1 _0 0 1 0 3kb 2042 false true {lucene_version} true
  92. --------------------------------------------------
  93. // TESTRESPONSE[s/3kb/\\d+(\\.\\d+)?[mk]?b/ s/2042/\\d+/ non_json]