2014-05-05 10:23:00 -04:00
|
|
|
[[cat-fielddata]]
|
2019-08-13 08:35:08 -04:00
|
|
|
=== cat fielddata API
|
|
|
|
++++
|
|
|
|
<titleabbrev>cat fielddata</titleabbrev>
|
|
|
|
++++
|
2014-05-05 10:23:00 -04:00
|
|
|
|
2019-08-06 10:33:30 -04:00
|
|
|
Returns the amount of heap memory currently used by fielddata on every data node
|
|
|
|
in the cluster.
|
2014-05-05 10:23:00 -04:00
|
|
|
|
2016-10-07 16:28:49 -04:00
|
|
|
|
2019-08-06 10:33:30 -04:00
|
|
|
[[cat-fielddata-api-request]]
|
|
|
|
==== {api-request-title}
|
|
|
|
|
|
|
|
`GET /_cat/fielddata/{fields}`
|
|
|
|
|
|
|
|
|
|
|
|
[[cat-fielddata-api-path-params]]
|
|
|
|
==== {api-path-parms-title}
|
|
|
|
|
|
|
|
`{fields}`::
|
|
|
|
(Optional, string) Comma-separated list of fields used to limit returned
|
|
|
|
information.
|
|
|
|
|
|
|
|
|
|
|
|
[[cat-fielddata-api-query-params]]
|
|
|
|
==== {api-query-parms-title}
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=bytes]
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=http-format]
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=local]
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=master-timeout]
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-h]
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=help]
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-s]
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-v]
|
|
|
|
|
|
|
|
|
|
|
|
[[cat-fielddata-api-example]]
|
|
|
|
==== {api-examples-title}
|
|
|
|
|
2016-10-07 16:28:49 -04:00
|
|
|
////
|
|
|
|
Hidden setup snippet to build an index with fielddata so our results are real:
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
2019-01-18 08:11:18 -05:00
|
|
|
PUT test
|
2016-10-07 16:28:49 -04:00
|
|
|
{
|
|
|
|
"mappings": {
|
2019-01-18 08:11:18 -05:00
|
|
|
"properties": {
|
|
|
|
"body": {
|
|
|
|
"type": "text",
|
|
|
|
"fielddata":true
|
|
|
|
},
|
|
|
|
"soul": {
|
|
|
|
"type": "text",
|
|
|
|
"fielddata":true
|
2019-08-06 10:33:30 -04:00
|
|
|
},
|
|
|
|
"mind": {
|
|
|
|
"type": "text",
|
|
|
|
"fielddata":true
|
2016-10-07 16:28:49 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-10-22 14:54:04 -04:00
|
|
|
POST test/_doc?refresh
|
2016-10-07 16:28:49 -04:00
|
|
|
{
|
|
|
|
"body": "some words so there is a little field data",
|
2019-08-06 10:33:30 -04:00
|
|
|
"soul": "some more words",
|
|
|
|
"mind": "even more words"
|
2016-10-07 16:28:49 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
# Perform a search to load the field data
|
2019-08-06 10:33:30 -04:00
|
|
|
POST test/_search?sort=body,soul,mind
|
2016-10-07 16:28:49 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
////
|
|
|
|
|
2019-08-06 10:33:30 -04:00
|
|
|
[[cat-fielddata-api-example-ind]]
|
|
|
|
===== Example with an individual field
|
|
|
|
|
|
|
|
You can specify an individual field in the request body or URL path. The
|
|
|
|
following `fieldata` API request retrieves heap memory size information for the
|
|
|
|
`body` field.
|
|
|
|
|
2016-10-07 16:28:49 -04:00
|
|
|
[source,js]
|
2014-05-05 10:23:00 -04:00
|
|
|
--------------------------------------------------
|
2019-08-06 10:33:30 -04:00
|
|
|
GET /_cat/fielddata?v&fields=body
|
2014-05-05 10:23:00 -04:00
|
|
|
--------------------------------------------------
|
2016-10-07 16:28:49 -04:00
|
|
|
// CONSOLE
|
|
|
|
// TEST[continued]
|
|
|
|
|
2019-08-06 10:33:30 -04:00
|
|
|
The API returns the following response:
|
2016-10-07 16:28:49 -04:00
|
|
|
|
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/]
|
2019-08-06 10:33:30 -04:00
|
|
|
// TESTRESPONSE[s/Nqk-6in[^ ]*/.+/ non_json]
|
|
|
|
|
|
|
|
[[cat-fielddata-api-example-list]]
|
|
|
|
===== Example with a list of fields
|
|
|
|
|
|
|
|
You can specify a comma-separated list of fields in the request body or URL
|
|
|
|
path. The following `fieldata` API request retrieves heap memory size
|
|
|
|
information for the `body` and `soul` fields.
|
2014-05-05 10:23:00 -04:00
|
|
|
|
|
|
|
|
2016-10-07 16:28:49 -04:00
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
2019-08-06 10:33:30 -04:00
|
|
|
GET /_cat/fielddata/body,soul?v
|
2016-10-07 16:28:49 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TEST[continued]
|
|
|
|
|
2019-08-06 10:33:30 -04:00
|
|
|
The API returns the following response:
|
2016-10-07 16:28:49 -04:00
|
|
|
|
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
|
2019-08-06 10:33:30 -04:00
|
|
|
Nqk-6inXQq-OxUfOUI8jNQ 127.0.0.1 127.0.0.1 Nqk-6in soul 480b
|
2016-10-07 16:28:49 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
// TESTRESPONSE[s/544b|480b/\\d+(\\.\\d+)?[tgmk]?b/]
|
2019-08-06 10:33:30 -04:00
|
|
|
// TESTRESPONSE[s/Nqk-6in[^ ]*/.+/ s/soul|body/\\w+/ non_json]
|
|
|
|
|
|
|
|
The response shows the individual fielddata for the `body` and `soul` fields,
|
|
|
|
one row per field per node.
|
|
|
|
|
|
|
|
[[cat-fielddata-api-example-all]]
|
|
|
|
===== Example with all fields in a cluster
|
2016-10-07 16:28:49 -04:00
|
|
|
|
2019-08-06 10:33:30 -04:00
|
|
|
The following `fieldata` API request retrieves heap memory size
|
|
|
|
information all fields.
|
2016-10-07 16:28:49 -04:00
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
2019-08-06 10:33:30 -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]
|
2014-05-05 10:23:00 -04:00
|
|
|
|
2019-08-06 10:33:30 -04:00
|
|
|
The API returns the following response:
|
2016-10-07 16:28:49 -04:00
|
|
|
|
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
|
2019-08-06 10:33:30 -04:00
|
|
|
Nqk-6inXQq-OxUfOUI8jNQ 127.0.0.1 127.0.0.1 Nqk-6in mind 360b
|
2016-10-07 16:28:49 -04:00
|
|
|
Nqk-6inXQq-OxUfOUI8jNQ 127.0.0.1 127.0.0.1 Nqk-6in soul 480b
|
2014-05-05 10:23:00 -04:00
|
|
|
--------------------------------------------------
|
2019-08-06 10:33:30 -04:00
|
|
|
// TESTRESPONSE[s/544b|480b|360b/\\d+(\\.\\d+)?[tgmk]?b/]
|
|
|
|
// TESTRESPONSE[s/Nqk-6in[^ ]*/.+/ s/soul|body|mind/\\w+/ non_json]
|