stats.asciidoc 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. You can include statistics for custom groups by adding
  27. an extra `groups` parameter (search operations can be associated with one or more
  28. groups). The `groups` parameter accepts a comma separated list of group names.
  29. Use `_all` to return statistics for all groups.
  30. `completion`:: Completion suggest statistics.
  31. `fielddata`:: Fielddata statistics.
  32. `flush`:: Flush statistics.
  33. `merge`:: Merge statistics.
  34. `request_cache`:: <<shard-request-cache,Shard request cache>> statistics.
  35. `refresh`:: Refresh statistics.
  36. `suggest`:: Suggest statistics.
  37. `warmer`:: Warmer statistics.
  38. `translog`:: Translog statistics.
  39. Some statistics allow per field granularity which accepts a list
  40. comma-separated list of included fields. By default all fields are included:
  41. [horizontal]
  42. `fields`::
  43. List of fields to be included in the statistics. This is used as the
  44. default list unless a more specific field list is provided (see below).
  45. `completion_fields`::
  46. List of fields to be included in the Completion Suggest statistics.
  47. `fielddata_fields`::
  48. List of fields to be included in the Fielddata statistics.
  49. Here are some samples:
  50. [source,js]
  51. --------------------------------------------------
  52. # Get back stats for merge and refresh only for all indices
  53. curl 'localhost:9200/_stats/merge,refresh'
  54. # Get back stats for type1 and type2 documents for the my_index index
  55. curl 'localhost:9200/my_index/_stats/indexing?types=type1,type2
  56. # Get back just search stats for group1 and group2
  57. curl 'localhost:9200/_stats/search?groups=group1,group2
  58. --------------------------------------------------
  59. The stats returned are aggregated on the index level, with
  60. `primaries` and `total` aggregations, where `primaries` are the values for only the
  61. primary shards, and `total` are the cumulated values for both primary and replica shards.
  62. In order to get back shard level stats, set the `level` parameter to `shards`.
  63. Note, as shards move around the cluster, their stats will be cleared as
  64. they are created on other nodes. On the other hand, even though a shard
  65. "left" a node, that node will still retain the stats that shard
  66. contributed to.