segments.asciidoc 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. [[cat-segments]]
  2. == cat segments
  3. The `segments` command provides low level information about the segments
  4. in the shards of an index. It provides information similar to the
  5. link:indices-segments.html[_segments] endpoint. For example:
  6. [source,js]
  7. --------------------------------------------------
  8. GET /_cat/segments?v
  9. --------------------------------------------------
  10. // CONSOLE
  11. // TEST[s/^/PUT \/test\/test\/1?refresh\n{"test":"test"}\nPUT \/test1\/test\/1?refresh\n{"test":"test"}\n/]
  12. might look like:
  13. ["source","txt",subs="attributes,callouts"]
  14. --------------------------------------------------
  15. index shard prirep ip segment generation docs.count docs.deleted size size.memory committed searchable version compound
  16. test 0 p 127.0.0.1 _0 0 1 0 3kb 2042 false true {lucene_version} true
  17. test1 0 p 127.0.0.1 _0 0 1 0 3kb 2042 false true {lucene_version} true
  18. --------------------------------------------------
  19. // TESTRESPONSE[s/3kb/\\d+(\\.\\d+)?[mk]?b/ s/2042/\\d+/ _cat]
  20. The output shows information about index names and shard numbers in the first
  21. two columns.
  22. If you only want to get information about segments in one particular index,
  23. you can add the index name in the URL, for example `/_cat/segments/test`. Also,
  24. several indexes can be queried like `/_cat/segments/test,test1`
  25. The following columns provide additional monitoring information:
  26. prirep:: Whether this segment belongs to a primary or replica shard.
  27. ip:: The ip address of the segment's shard.
  28. segment:: A segment name, derived from the segment generation. The name
  29. is internally used to generate the file names in the directory
  30. of the shard this segment belongs to.
  31. generation:: The generation number is incremented with each segment that is written.
  32. The name of the segment is derived from this generation number.
  33. docs.count:: The number of non-deleted documents that are stored in this segment.
  34. Note that these are Lucene documents, so the count will include hidden
  35. documents (e.g. from nested types).
  36. docs.deleted:: The number of deleted documents that are stored in this segment.
  37. It is perfectly fine if this number is greater than 0, space is
  38. going to be reclaimed when this segment gets merged.
  39. size:: The amount of disk space that this segment uses.
  40. size.memory:: Segments store some data into memory in order to be searchable efficiently.
  41. This column shows the number of bytes in memory that are used.
  42. committed:: Whether the segment has been sync'ed on disk. Segments that are
  43. committed would survive a hard reboot. No need to worry in case
  44. of false, the data from uncommitted segments is also stored in
  45. the transaction log so that Elasticsearch is able to replay
  46. changes on the next start.
  47. searchable:: True if the segment is searchable. A value of false would most
  48. likely mean that the segment has been written to disk but no
  49. refresh occurred since then to make it searchable.
  50. version:: The version of Lucene that has been used to write this segment.
  51. compound:: Whether the segment is stored in a compound file. When true, this
  52. means that Lucene merged all files from the segment in a single
  53. one in order to save file descriptors.