stats.asciidoc 3.5 KB

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