cat fielddata API

cat fielddata API

New API reference

For the most up-to-date API details, refer to Compact and aligned text (CAT) APIs..

cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes stats API.

Returns the amount of heap memory currently used by the field data cache on every data node in the cluster.

Request

GET /_cat/fielddata/<field>

GET /_cat/fielddata

Prerequisites

  • If the Elasticsearch security features are enabled, you must have the monitor or manage cluster privilege to use this API.

Path parameters

<field>

(Optional, string) Comma-separated list of fields used to limit returned information.

Query parameters

bytes

(Optional, byte size units) Unit used to display byte values.

format

(Optional, string) Short version of the HTTP accept header. Valid values include JSON, YAML, etc.

h

(Optional, string) Comma-separated list of column names to display.

help

(Optional, Boolean) If true, the response includes help information. Defaults to false.

s

(Optional, string) Comma-separated list of column names or column aliases used to sort the response.

v

(Optional, Boolean) If true, the response includes column headings. Defaults to false.

Examples

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.

  1. resp = client.cat.fielddata(
  2. v=True,
  3. fields="body",
  4. )
  5. print(resp)
  1. response = client.cat.fielddata(
  2. v: true,
  3. fields: 'body'
  4. )
  5. puts response
  1. const response = await client.cat.fielddata({
  2. v: "true",
  3. fields: "body",
  4. });
  5. console.log(response);
  1. GET /_cat/fielddata?v=true&fields=body

The API returns the following response:

  1. id host ip node field size
  2. Nqk-6inXQq-OxUfOUI8jNQ 127.0.0.1 127.0.0.1 Nqk-6in body 544b

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.

  1. resp = client.cat.fielddata(
  2. fields="body,soul",
  3. v=True,
  4. )
  5. print(resp)
  1. response = client.cat.fielddata(
  2. fields: 'body,soul',
  3. v: true
  4. )
  5. puts response
  1. const response = await client.cat.fielddata({
  2. fields: "body,soul",
  3. v: "true",
  4. });
  5. console.log(response);
  1. GET /_cat/fielddata/body,soul?v=true

The API returns the following response:

  1. id host ip node field size
  2. Nqk-6inXQq-OxUfOUI8jNQ 127.0.0.1 127.0.0.1 Nqk-6in body 544b
  3. Nqk-6inXQq-OxUfOUI8jNQ 127.0.0.1 127.0.0.1 Nqk-6in soul 480b

The response shows the individual fielddata for the body and soul fields, one row per field per node.

Example with all fields in a cluster

The following fieldata API request retrieves heap memory size information all fields.

  1. resp = client.cat.fielddata(
  2. v=True,
  3. )
  4. print(resp)
  1. response = client.cat.fielddata(
  2. v: true
  3. )
  4. puts response
  1. const response = await client.cat.fielddata({
  2. v: "true",
  3. });
  4. console.log(response);
  1. GET /_cat/fielddata?v=true

The API returns the following response:

  1. id host ip node field size
  2. Nqk-6inXQq-OxUfOUI8jNQ 127.0.0.1 127.0.0.1 Nqk-6in body 544b
  3. Nqk-6inXQq-OxUfOUI8jNQ 127.0.0.1 127.0.0.1 Nqk-6in mind 360b
  4. Nqk-6inXQq-OxUfOUI8jNQ 127.0.0.1 127.0.0.1 Nqk-6in soul 480b