segments.asciidoc 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. [[cat-segments-api-request]]
  10. ==== {api-request-title}
  11. `GET /_cat/segments/<index>`
  12. `GET /_cat/segments`
  13. [[cat-segments-path-params]]
  14. ==== {api-path-parms-title}
  15. include::{docdir}/rest-api/common-parms.asciidoc[tag=index]
  16. [[cat-segments-query-params]]
  17. ==== {api-query-parms-title}
  18. include::{docdir}/rest-api/common-parms.asciidoc[tag=bytes]
  19. include::{docdir}/rest-api/common-parms.asciidoc[tag=http-format]
  20. include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-h]
  21. +
  22. --
  23. If you do not specify which columns to include, the API returns the default
  24. columns in the order listed below. If you explicitly specify one or more
  25. columns, it only returns the specified columns.
  26. Valid columns are:
  27. `index`, `i`, `idx`::
  28. (Default) Name of the index, such as `twitter`.
  29. `shard`, `s`, `sh`::
  30. (Default) Name of the shard.
  31. `prirep`, `p`, `pr`, `primaryOrReplica`::
  32. (Default) Shard type. Returned values are `primary` or `replica`.
  33. `ip`::
  34. (Default) IP address of the segment's shard, such as `127.0.1.1`.
  35. `segment`::
  36. (Default)
  37. include::{docdir}/rest-api/common-parms.asciidoc[tag=segment]
  38. `generation`::
  39. (Default)
  40. include::{docdir}/rest-api/common-parms.asciidoc[tag=generation]
  41. `docs.count`::
  42. (Default)
  43. include::{docdir}/rest-api/common-parms.asciidoc[tag=docs-count]
  44. `docs.deleted`::
  45. (Default)
  46. include::{docdir}/rest-api/common-parms.asciidoc[tag=docs-deleted]
  47. `size`::
  48. (Default)
  49. include::{docdir}/rest-api/common-parms.asciidoc[tag=segment-size]
  50. `size.memory`::
  51. (Default)
  52. include::{docdir}/rest-api/common-parms.asciidoc[tag=memory]
  53. `committed`::
  54. (Default)
  55. include::{docdir}/rest-api/common-parms.asciidoc[tag=committed]
  56. `searchable`::
  57. (Default)
  58. include::{docdir}/rest-api/common-parms.asciidoc[tag=segment-search]
  59. `version`::
  60. (Default)
  61. include::{docdir}/rest-api/common-parms.asciidoc[tag=segment-version]
  62. `compound`::
  63. (Default) If `true`, the segment is stored in a compound file. This means Lucene
  64. merged all files from the segment in a single file to save file descriptors.
  65. `id`::
  66. ID of the node, such as `k0zy`.
  67. --
  68. include::{docdir}/rest-api/common-parms.asciidoc[tag=help]
  69. include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-s]
  70. include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-v]
  71. [[cat-segments-api-example]]
  72. ==== {api-examples-title}
  73. [source,console]
  74. --------------------------------------------------
  75. GET /_cat/segments?v
  76. --------------------------------------------------
  77. // TEST[s/^/PUT \/test\/test\/1?refresh\n{"test":"test"}\nPUT \/test1\/test\/1?refresh\n{"test":"test"}\n/]
  78. The API returns the following response:
  79. ["source","txt",subs="attributes,callouts"]
  80. --------------------------------------------------
  81. index shard prirep ip segment generation docs.count docs.deleted size size.memory committed searchable version compound
  82. test 0 p 127.0.0.1 _0 0 1 0 3kb 2042 false true {lucene_version} true
  83. test1 0 p 127.0.0.1 _0 0 1 0 3kb 2042 false true {lucene_version} true
  84. --------------------------------------------------
  85. // TESTRESPONSE[s/3kb/\\d+(\\.\\d+)?[mk]?b/ s/2042/\\d+/ non_json]