stats.asciidoc 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. [[indices-stats]]
  2. == Indices Stats
  3. Indices level stats provide statistics on different operations happening
  4. on an index. The API provides statistics on the index level scope
  5. (though most stats can also be retrieved using node level scope).
  6. The following returns high level aggregation and index level stats for
  7. all indices:
  8. [source,js]
  9. --------------------------------------------------
  10. curl localhost:9200/_stats
  11. --------------------------------------------------
  12. Specific index stats can be retrieved using:
  13. [source,js]
  14. --------------------------------------------------
  15. curl localhost:9200/index1,index2/_stats
  16. --------------------------------------------------
  17. By default, all stats are returned, returning only specific stats can be
  18. specified as well in the URI. Those stats can be any of:
  19. [horizontal]
  20. `docs`:: The number of docs / deleted docs (docs not yet merged out).
  21. Note, affected by refreshing the index.
  22. `store`:: The size of the index.
  23. `indexing`:: Indexing statistics, can be combined with a comma
  24. separated list of `types` to provide document type level stats.
  25. `get`:: Get statistics, including missing stats.
  26. `search`:: Search statistics including suggest statistics.
  27. You can include statistics for custom groups by adding
  28. an extra `groups` parameter (search operations can be associated with one or more
  29. groups). The `groups` parameter accepts a comma separated list of group names.
  30. Use `_all` to return statistics for all groups.
  31. `segments`:: Retrieve the memory use of the open segments. Optionally, setting the `include_segment_file_sizes` flag, report the aggregated disk usage of each one of the Lucene index files.
  32. `completion`:: Completion suggest statistics.
  33. `fielddata`:: Fielddata statistics.
  34. `flush`:: Flush statistics.
  35. `merge`:: Merge statistics.
  36. `request_cache`:: <<shard-request-cache,Shard request cache>> statistics.
  37. `refresh`:: Refresh statistics.
  38. `warmer`:: Warmer statistics.
  39. `translog`:: Translog statistics.
  40. Some statistics allow per field granularity which accepts a list
  41. comma-separated list of included fields. By default all fields are included:
  42. [horizontal]
  43. `fields`::
  44. List of fields to be included in the statistics. This is used as the
  45. default list unless a more specific field list is provided (see below).
  46. `completion_fields`::
  47. List of fields to be included in the Completion Suggest statistics.
  48. `fielddata_fields`::
  49. List of fields to be included in the Fielddata statistics.
  50. Here are some samples:
  51. [source,js]
  52. --------------------------------------------------
  53. # Get back stats for merge and refresh only for all indices
  54. curl 'localhost:9200/_stats/merge,refresh'
  55. # Get back stats for type1 and type2 documents for the my_index index
  56. curl 'localhost:9200/my_index/_stats/indexing?types=type1,type2
  57. # Get back just search stats for group1 and group2
  58. curl 'localhost:9200/_stats/search?groups=group1,group2
  59. --------------------------------------------------
  60. The stats returned are aggregated on the index level, with
  61. `primaries` and `total` aggregations, where `primaries` are the values for only the
  62. primary shards, and `total` are the cumulated values for both primary and replica shards.
  63. In order to get back shard level stats, set the `level` parameter to `shards`.
  64. Note, as shards move around the cluster, their stats will be cleared as
  65. they are created on other nodes. On the other hand, even though a shard
  66. "left" a node, that node will still retain the stats that shard
  67. contributed to.