fielddata.asciidoc 2.7 KB

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