segments.asciidoc 3.4 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.
  6. [source,sh]
  7. --------------------------------------------------
  8. % curl 'http://localhost:9200/_cat/segments?v'
  9. index shard prirep ip segment generation docs.count [...]
  10. test 4 p 192.168.2.105 _0 0 1
  11. test1 2 p 192.168.2.105 _0 0 1
  12. test1 3 p 192.168.2.105 _2 2 1
  13. --------------------------------------------------
  14. [source,sh]
  15. --------------------------------------------------
  16. [...] docs.deleted size size.memory committed searchable version compound
  17. 0 2.9kb 7818 false true 4.10.2 true
  18. 0 2.9kb 7818 false true 4.10.2 true
  19. 0 2.9kb 7818 false true 4.10.2 true
  20. --------------------------------------------------
  21. The output shows information about index names and shard numbers in the first
  22. two columns.
  23. If you only want to get information about segments in one particular index,
  24. you can add the index name in the URL, for example `/_cat/segments/test`. Also,
  25. several indexes can be queried like `/_cat/segments/test,test1`
  26. The following columns provide additional monitoring information:
  27. prirep:: Whether this segment belongs to a primary or replica shard.
  28. ip:: The ip address of the segments shard.
  29. segment:: A segment name, derived from the segment generation. The name
  30. is internally used to generate the file names in the directory
  31. of the shard this segment belongs to.
  32. generation:: The generation number is incremented with each segment that is written.
  33. The name of the segment is derived from this generation number.
  34. docs.count:: The number of non-deleted documents that are stored in this segment.
  35. Note that these are Lucene documents, so the count will include hidden
  36. documents (e.g. from nested types).
  37. docs.deleted:: The number of deleted documents that are stored in this segment.
  38. It is perfectly fine if this number is greater than 0, space is
  39. going to be reclaimed when this segment gets merged.
  40. size:: The amount of disk space that this segment uses.
  41. size.memory:: Segments store some data into memory in order to be searchable efficiently.
  42. This column shows the number of bytes in memory that are used.
  43. committed:: Whether the segment has been sync'ed on disk. Segments that are
  44. committed would survive a hard reboot. No need to worry in case
  45. of false, the data from uncommitted segments is also stored in
  46. the transaction log so that Elasticsearch is able to replay
  47. changes on the next start.
  48. searchable:: True if the segment is searchable. A value of false would most
  49. likely mean that the segment has been written to disk but no
  50. refresh occurred since then to make it searchable.
  51. version:: The version of Lucene that has been used to write this segment.
  52. compound:: Whether the segment is stored in a compound file. When true, this
  53. means that Lucene merged all files from the segment in a single
  54. one in order to save file descriptors.