stats.asciidoc 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. `warmer`:: Warmer statistics.
  31. `merge`:: Merge statistics.
  32. `fielddata`:: Fielddata statistics.
  33. `flush`:: Flush statistics.
  34. `completion`:: Completion suggest statistics.
  35. `refresh`:: Refresh statistics.
  36. `suggest`:: Suggest statistics.
  37. Some statistics allow per field granularity which accepts a list comma-separated list of included fields. By default all fields are included:
  38. [horizontal]
  39. `fields`:: List of fields to be included in the statistics. This is used as the default list unless a more specific field list is provided (see below).
  40. `completion_fields`:: List of fields to be included in the Completion Suggest statistics
  41. `fielddata_fields`:: List of fields to be included in the Fielddata statistics
  42. Here are some samples:
  43. [source,js]
  44. --------------------------------------------------
  45. # Get back stats for merge and refresh only for all indices
  46. curl 'localhost:9200/_stats/merge,refresh'
  47. # Get back stats for type1 and type2 documents for the my_index index
  48. curl 'localhost:9200/my_index/_stats/indexing?types=type1,type2
  49. # Get back just search stats for group1 and group2
  50. curl 'localhost:9200/_stats/search?groups=group1,group2
  51. --------------------------------------------------
  52. The stats returned are aggregated on the index level, with
  53. `primaries` and `total` aggregations. In order to get back shard level
  54. stats, set the `level` parameter to `shards`.
  55. Note, as shards move around the cluster, their stats will be cleared as
  56. they are created on other nodes. On the other hand, even though a shard
  57. "left" a node, that node will still retain the stats that shard
  58. contributed to.