From 74cf05595e5fb430f68a9de530cd01a914f3fb01 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Wed, 1 Jul 2015 12:05:12 +0200 Subject: [PATCH] docs: Fix field stats docs. --- docs/reference/search/field-stats.asciidoc | 26 +++++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/docs/reference/search/field-stats.asciidoc b/docs/reference/search/field-stats.asciidoc index 5e7b08c7a79..bef6c45f9ef 100644 --- a/docs/reference/search/field-stats.asciidoc +++ b/docs/reference/search/field-stats.asciidoc @@ -37,7 +37,7 @@ Alternatively the `fields` option can also be defined in the request body: [source,js] -------------------------------------------------- -curl -XPOST 'http://localhost:9200/_field_stats?level=indices' -d '{ +curl -XPOST "http://localhost:9200/_field_stats?level=indices" -d '{ "fields" : ["rating"] }' -------------------------------------------------- @@ -88,15 +88,18 @@ The highest value in the field represented in a displayable form. NOTE: Documents marked as deleted (but not yet removed by the merge process) still affect all the mentioned statistics. +[float] +=== Cluster level field statistics example -.Cluster level field statistics -================================================== +Request: [source,js] -------------------------------------------------- -GET /_field_stats?fields=rating,answer_count,creation_date,display_name +curl -XGET "http://localhost:9200/_field_stats?fields=rating,answer_count,creation_date,display_name" -------------------------------------------------- +Response: + [source,json] -------------------------------------------------- { @@ -151,16 +154,19 @@ GET /_field_stats?fields=rating,answer_count,creation_date,display_name -------------------------------------------------- <1> The `_all` key indicates that it contains the field stats of all indices in the cluster. -================================================== -.Indices level field statistics -================================================== +[float] +==== Indices level field statistics example + +Request: [source,js] -------------------------------------------------- -GET /_field_stats?fields=rating,answer_count,creation_date,display_name&level=indices +curl -XGET "http://localhost:9200/_field_stats?fields=rating,answer_count,creation_date,display_name&level=indices" -------------------------------------------------- +Response: + [source,js] -------------------------------------------------- { @@ -229,7 +235,7 @@ holding questions created in the year 2014: [source,js] -------------------------------------------------- -curl -XPOST 'http://localhost:9200/_field_stats?level=indices' -d '{ +curl -XPOST "http://localhost:9200/_field_stats?level=indices" -d '{ "fields" : ["answer_count"] <1> "index_constraints" : { <2> "creation_date" : { <3> @@ -257,5 +263,3 @@ Each index constraint support the following comparisons: `gt`:: Greater-than `lte`:: Less-than or equal to `lt`:: Less-than - -==================================================