diff --git a/docs/reference/aggregations/bucket/terms-aggregation.asciidoc b/docs/reference/aggregations/bucket/terms-aggregation.asciidoc index 5f985df78d454..a29fae91c2677 100644 --- a/docs/reference/aggregations/bucket/terms-aggregation.asciidoc +++ b/docs/reference/aggregations/bucket/terms-aggregation.asciidoc @@ -60,16 +60,13 @@ GET /_search { "aggs": { "genres": { - "terms": { "field": "genre" } <1> + "terms": { "field": "genre" } } } } -------------------------------------------------- // TEST[s/_search/_search\?filter_path=aggregations/] -<1> `terms` aggregation should be a field of type `keyword` or any other data type suitable for bucket aggregations. In order to use it with `text` you will need to enable -<>. - Response: [source,console-result] @@ -107,6 +104,16 @@ Response: By default, the `terms` aggregation will return the buckets for the top ten terms ordered by the `doc_count`. One can change this default behaviour by setting the `size` parameter. +[[search-aggregations-bucket-terms-aggregation-types]] +The `field` can be <>, <>, <>, <>, +or <>. + +NOTE: By default, you cannot run a `terms` aggregation on a `text` field. Use a +`keyword` <> instead. Alternatively, you can enable +<> on the `text` field to create buckets for the field's +<> terms. Enabling `fielddata` can significantly increase +memory usage. + [[search-aggregations-bucket-terms-aggregation-size]] ==== Size