fielddata.asciidoc 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. [[cat-fielddata]]
  2. === cat fielddata API
  3. ++++
  4. <titleabbrev>cat fielddata</titleabbrev>
  5. ++++
  6. Returns the amount of heap memory currently used by fielddata on every data node
  7. in the cluster.
  8. [[cat-fielddata-api-request]]
  9. ==== {api-request-title}
  10. `GET /_cat/fielddata/<field>`
  11. `GET /_cat/fielddata`
  12. [[cat-fielddata-api-path-params]]
  13. ==== {api-path-parms-title}
  14. `<field>`::
  15. (Optional, string) Comma-separated list of fields used to limit returned
  16. information.
  17. [[cat-fielddata-api-query-params]]
  18. ==== {api-query-parms-title}
  19. include::{docdir}/rest-api/common-parms.asciidoc[tag=bytes]
  20. include::{docdir}/rest-api/common-parms.asciidoc[tag=http-format]
  21. include::{docdir}/rest-api/common-parms.asciidoc[tag=local]
  22. include::{docdir}/rest-api/common-parms.asciidoc[tag=master-timeout]
  23. include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-h]
  24. include::{docdir}/rest-api/common-parms.asciidoc[tag=help]
  25. include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-s]
  26. include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-v]
  27. [[cat-fielddata-api-example]]
  28. ==== {api-examples-title}
  29. ////
  30. Hidden setup snippet to build an index with fielddata so our results are real:
  31. [source,console,id=cat-fielddata-example]
  32. --------------------------------------------------
  33. PUT test
  34. {
  35. "mappings": {
  36. "properties": {
  37. "body": {
  38. "type": "text",
  39. "fielddata":true
  40. },
  41. "soul": {
  42. "type": "text",
  43. "fielddata":true
  44. },
  45. "mind": {
  46. "type": "text",
  47. "fielddata":true
  48. }
  49. }
  50. }
  51. }
  52. POST test/_doc?refresh
  53. {
  54. "body": "some words so there is a little field data",
  55. "soul": "some more words",
  56. "mind": "even more words"
  57. }
  58. # Perform a search to load the field data
  59. POST test/_search?sort=body,soul,mind
  60. --------------------------------------------------
  61. ////
  62. [[cat-fielddata-api-example-ind]]
  63. ===== Example with an individual field
  64. You can specify an individual field in the request body or URL path. The
  65. following `fieldata` API request retrieves heap memory size information for the
  66. `body` field.
  67. [source,console]
  68. --------------------------------------------------
  69. GET /_cat/fielddata?v&fields=body
  70. --------------------------------------------------
  71. // TEST[continued]
  72. The API returns the following response:
  73. [source,txt]
  74. --------------------------------------------------
  75. id host ip node field size
  76. Nqk-6inXQq-OxUfOUI8jNQ 127.0.0.1 127.0.0.1 Nqk-6in body 544b
  77. --------------------------------------------------
  78. // TESTRESPONSE[s/544b|480b/\\d+(\\.\\d+)?[tgmk]?b/]
  79. // TESTRESPONSE[s/Nqk-6in[^ ]*/.+/ non_json]
  80. [[cat-fielddata-api-example-list]]
  81. ===== Example with a list of fields
  82. You can specify a comma-separated list of fields in the request body or URL
  83. path. The following `fieldata` API request retrieves heap memory size
  84. information for the `body` and `soul` fields.
  85. [source,console]
  86. --------------------------------------------------
  87. GET /_cat/fielddata/body,soul?v
  88. --------------------------------------------------
  89. // TEST[continued]
  90. The API returns the following response:
  91. [source,txt]
  92. --------------------------------------------------
  93. id host ip node field size
  94. Nqk-6inXQq-OxUfOUI8jNQ 127.0.0.1 127.0.0.1 Nqk-6in body 544b
  95. Nqk-6inXQq-OxUfOUI8jNQ 127.0.0.1 127.0.0.1 Nqk-6in soul 480b
  96. --------------------------------------------------
  97. // TESTRESPONSE[s/544b|480b/\\d+(\\.\\d+)?[tgmk]?b/]
  98. // TESTRESPONSE[s/Nqk-6in[^ ]*/.+/ s/soul|body/\\w+/ non_json]
  99. The response shows the individual fielddata for the `body` and `soul` fields,
  100. one row per field per node.
  101. [[cat-fielddata-api-example-all]]
  102. ===== Example with all fields in a cluster
  103. The following `fieldata` API request retrieves heap memory size
  104. information all fields.
  105. [source,console]
  106. --------------------------------------------------
  107. GET /_cat/fielddata?v
  108. --------------------------------------------------
  109. // TEST[continued]
  110. The API returns the following response:
  111. [source,txt]
  112. --------------------------------------------------
  113. id host ip node field size
  114. Nqk-6inXQq-OxUfOUI8jNQ 127.0.0.1 127.0.0.1 Nqk-6in body 544b
  115. Nqk-6inXQq-OxUfOUI8jNQ 127.0.0.1 127.0.0.1 Nqk-6in mind 360b
  116. Nqk-6inXQq-OxUfOUI8jNQ 127.0.0.1 127.0.0.1 Nqk-6in soul 480b
  117. --------------------------------------------------
  118. // TESTRESPONSE[s/544b|480b|360b/\\d+(\\.\\d+)?[tgmk]?b/]
  119. // TESTRESPONSE[s/Nqk-6in[^ ]*/.+/ s/soul|body|mind/\\w+/ non_json]