diff --git a/docs/reference/search/field-stats.asciidoc b/docs/reference/search/field-stats.asciidoc index 65dc2c2a6bf..7cac3e7e5c3 100644 --- a/docs/reference/search/field-stats.asciidoc +++ b/docs/reference/search/field-stats.asciidoc @@ -25,27 +25,60 @@ curl -XGET "http://localhost:9200/index1,index2/_field_stats?fields=rating" Supported request options: -* `fields` - A list of fields to compute stats for. -* `level` - Defines if field stats should be returned on a per index level or on a cluster wide level. Valid values are - `indices` and `cluster`. Defaults to `cluster`. +[horizontal] +`fields`:: + +A list of fields to compute stats for. + +`level`:: + +Defines if field stats should be returned on a per index level or on a cluster +wide level. Valid values are `indices` and `cluster`. Defaults to `cluster`. === Field statistics The field stats api is supported on string based, number based and date based fields and can return the following statistics per field: -* `max_doc` - The total number of documents. -* `doc_count` - The number of documents that have at least one term for this field, or -1 if this measurement isn't available on one or more shards. -* `density` - The percentage of documents that have at least one value for this field. This is a derived statistic and is based on the `max_doc` and `doc_count`. -* `sum_doc_freq` - The sum of each term's document frequency in this field, or -1 if this measurement isn't available on one or more shards. - Document frequency is the number of documents containing a particular term. -* `sum_total_term_freq` - The sum of the term frequencies of all terms in this field across all documents, or -1 if this measurement isn't available on one or more shards. - Term frequency is the total number of occurrences of a term in a particular document and field. -* `min_value` - The lowest value in the field represented in a displayable form. -* `max_value` - The highest value in the field represented in a displayable form. +[horizontal] +`max_doc`:: -Note that for all the mentioned statistics, documents marked as deleted aren't taken into account. The documents marked +The total number of documents. + +`doc_count`:: + +The number of documents that have at least one term for this field, or -1 if +this measurement isn't available on one or more shards. + +`density`:: + +The percentage of documents that have at least one value for this field. This +is a derived statistic and is based on the `max_doc` and `doc_count`. + +`sum_doc_freq`:: + +The sum of each term's document frequency in this field, or -1 if this +measurement isn't available on one or more shards. Document frequency is the +number of documents containing a particular term. + +`sum_total_term_freq`:: + +The sum of the term frequencies of all terms in this field across all +documents, or `-1` if this measurement isn't available on one or more shards. +Term frequency is the total number of occurrences of a term in a particular +document and field. + +`min_value`:: + +The lowest value in the field represented in a displayable form. + +`max_value`:: + +The highest value in the field represented in a displayable form. + +NOTE: For all the mentioned statistics, documents marked as deleted aren't taken into account. The documents marked as deleted are are only taken into account when the segments these documents reside on are merged away. +[float] === Example [source,js]