fielddata.asciidoc 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. [[cat-fielddata]]
  2. === cat fielddata
  3. `fielddata` shows how much heap memory is currently being used by fielddata
  4. on every data node in the cluster.
  5. ////
  6. Hidden setup snippet to build an index with fielddata so our results are real:
  7. [source,js]
  8. --------------------------------------------------
  9. PUT test
  10. {
  11. "mappings": {
  12. "properties": {
  13. "body": {
  14. "type": "text",
  15. "fielddata":true
  16. },
  17. "soul": {
  18. "type": "text",
  19. "fielddata":true
  20. }
  21. }
  22. }
  23. }
  24. POST test/_doc?refresh
  25. {
  26. "body": "some words so there is a little field data",
  27. "soul": "some more words"
  28. }
  29. # Perform a search to load the field data
  30. POST test/_search?sort=body,soul
  31. --------------------------------------------------
  32. // CONSOLE
  33. ////
  34. [source,js]
  35. --------------------------------------------------
  36. GET /_cat/fielddata?v
  37. --------------------------------------------------
  38. // CONSOLE
  39. // TEST[continued]
  40. Looks like:
  41. [source,txt]
  42. --------------------------------------------------
  43. id host ip node field size
  44. Nqk-6inXQq-OxUfOUI8jNQ 127.0.0.1 127.0.0.1 Nqk-6in body 544b
  45. Nqk-6inXQq-OxUfOUI8jNQ 127.0.0.1 127.0.0.1 Nqk-6in soul 480b
  46. --------------------------------------------------
  47. // TESTRESPONSE[s/544b|480b/\\d+(\\.\\d+)?[tgmk]?b/]
  48. // TESTRESPONSE[s/Nqk-6in[^ ]*/.+/ s/soul|body/\\w+/ non_json]
  49. Fields can be specified either as a query parameter, or in the URL path:
  50. [source,js]
  51. --------------------------------------------------
  52. GET /_cat/fielddata?v&fields=body
  53. --------------------------------------------------
  54. // CONSOLE
  55. // TEST[continued]
  56. Which looks like:
  57. [source,txt]
  58. --------------------------------------------------
  59. id host ip node field size
  60. Nqk-6inXQq-OxUfOUI8jNQ 127.0.0.1 127.0.0.1 Nqk-6in body 544b
  61. --------------------------------------------------
  62. // TESTRESPONSE[s/544b|480b/\\d+(\\.\\d+)?[tgmk]?b/]
  63. // TESTRESPONSE[s/Nqk-6in[^ ]*/.+/ non_json]
  64. And it accepts a comma delimited list:
  65. [source,js]
  66. --------------------------------------------------
  67. GET /_cat/fielddata/body,soul?v
  68. --------------------------------------------------
  69. // CONSOLE
  70. // TEST[continued]
  71. Which produces the same output as the first snippet:
  72. [source,txt]
  73. --------------------------------------------------
  74. id host ip node field size
  75. Nqk-6inXQq-OxUfOUI8jNQ 127.0.0.1 127.0.0.1 Nqk-6in body 544b
  76. Nqk-6inXQq-OxUfOUI8jNQ 127.0.0.1 127.0.0.1 Nqk-6in soul 480b
  77. --------------------------------------------------
  78. // TESTRESPONSE[s/544b|480b/\\d+(\\.\\d+)?[tgmk]?b/]
  79. // TESTRESPONSE[s/Nqk-6in[^ ]*/.+/ s/soul|body/\\w+/ non_json]
  80. The output shows the individual fielddata for the `body` and `soul` fields, one row per field per node.