2014-05-05 10:23:00 -04:00
|
|
|
[[cat-fielddata]]
|
2014-05-16 15:43:35 -04:00
|
|
|
== cat fielddata
|
2014-05-05 10:23:00 -04:00
|
|
|
|
2016-10-07 16:28:49 -04:00
|
|
|
`fielddata` shows how much heap memory is currently being used by fielddata
|
2015-02-06 01:31:17 -05:00
|
|
|
on every data node in the cluster.
|
2014-05-05 10:23:00 -04:00
|
|
|
|
2016-10-07 16:28:49 -04:00
|
|
|
|
|
|
|
////
|
|
|
|
Hidden setup snippet to build an index with fielddata so our results are real:
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
PUT test
|
|
|
|
{
|
|
|
|
"mappings": {
|
|
|
|
"test": {
|
|
|
|
"properties": {
|
|
|
|
"body": {
|
|
|
|
"type": "text",
|
|
|
|
"fielddata":true
|
|
|
|
},
|
|
|
|
"soul": {
|
|
|
|
"type": "text",
|
|
|
|
"fielddata":true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
POST test/test?refresh
|
|
|
|
{
|
|
|
|
"body": "some words so there is a little field data",
|
|
|
|
"soul": "some more words"
|
|
|
|
}
|
|
|
|
|
|
|
|
# Perform a search to load the field data
|
|
|
|
POST test/_search?sort=body,soul
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
////
|
|
|
|
|
|
|
|
[source,js]
|
2014-05-05 10:23:00 -04:00
|
|
|
--------------------------------------------------
|
2016-10-07 16:28:49 -04:00
|
|
|
GET /_cat/fielddata?v
|
2014-05-05 10:23:00 -04:00
|
|
|
--------------------------------------------------
|
2016-10-07 16:28:49 -04:00
|
|
|
// CONSOLE
|
|
|
|
// TEST[continued]
|
|
|
|
|
|
|
|
Looks like:
|
|
|
|
|
2016-10-25 10:56:30 -04:00
|
|
|
[source,txt]
|
2016-10-07 16:28:49 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
id host ip node field size
|
|
|
|
Nqk-6inXQq-OxUfOUI8jNQ 127.0.0.1 127.0.0.1 Nqk-6in body 544b
|
|
|
|
Nqk-6inXQq-OxUfOUI8jNQ 127.0.0.1 127.0.0.1 Nqk-6in soul 480b
|
|
|
|
--------------------------------------------------
|
|
|
|
// TESTRESPONSE[s/544b|480b/\\d+(\\.\\d+)?[tgmk]?b/]
|
|
|
|
// TESTRESPONSE[s/Nqk-6in[^ ]*/.+/ s/soul|body/\\w+/ _cat]
|
2014-05-05 10:23:00 -04:00
|
|
|
|
|
|
|
Fields can be specified either as a query parameter, or in the URL path:
|
|
|
|
|
2016-10-07 16:28:49 -04:00
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
GET /_cat/fielddata?v&fields=body
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TEST[continued]
|
|
|
|
|
|
|
|
Which looks like:
|
|
|
|
|
2016-10-25 10:56:30 -04:00
|
|
|
[source,txt]
|
2016-10-07 16:28:49 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
id host ip node field size
|
|
|
|
Nqk-6inXQq-OxUfOUI8jNQ 127.0.0.1 127.0.0.1 Nqk-6in body 544b
|
|
|
|
--------------------------------------------------
|
|
|
|
// TESTRESPONSE[s/544b|480b/\\d+(\\.\\d+)?[tgmk]?b/]
|
|
|
|
// TESTRESPONSE[s/Nqk-6in[^ ]*/.+/ _cat]
|
|
|
|
|
|
|
|
And it accepts a comma delimited list:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
GET /_cat/fielddata/body,soul?v
|
2014-05-05 10:23:00 -04:00
|
|
|
--------------------------------------------------
|
2016-10-07 16:28:49 -04:00
|
|
|
// CONSOLE
|
|
|
|
// TEST[continued]
|
2014-05-05 10:23:00 -04:00
|
|
|
|
2016-10-07 16:28:49 -04:00
|
|
|
Which produces the same output as the first snippet:
|
|
|
|
|
2016-10-25 10:56:30 -04:00
|
|
|
[source,txt]
|
2016-10-07 16:28:49 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
id host ip node field size
|
|
|
|
Nqk-6inXQq-OxUfOUI8jNQ 127.0.0.1 127.0.0.1 Nqk-6in body 544b
|
|
|
|
Nqk-6inXQq-OxUfOUI8jNQ 127.0.0.1 127.0.0.1 Nqk-6in soul 480b
|
2014-05-05 10:23:00 -04:00
|
|
|
--------------------------------------------------
|
2016-10-07 16:28:49 -04:00
|
|
|
// TESTRESPONSE[s/544b|480b/\\d+(\\.\\d+)?[tgmk]?b/]
|
|
|
|
// TESTRESPONSE[s/Nqk-6in[^ ]*/.+/ s/soul|body/\\w+/ _cat]
|
2014-05-05 10:23:00 -04:00
|
|
|
|
2016-04-20 12:10:01 -04:00
|
|
|
The output shows the individual fielddata for the`body` and `text` fields, one row per field per node.
|