浏览代码

Reference docs fixes

* Make it clearer that `aggs` is an allowed synomym
  for the `aggregations` key
* Fix broken example in for datehistogram, `1.5M` is
  not an allowed interval
* Make use of colon before examples consistent
* Fix typos
Florian Gilcher 11 年之前
父节点
当前提交
eed079aaac

+ 1 - 1
docs/reference/search/aggregations.asciidoc

@@ -67,7 +67,7 @@ The following snippet captures the basic structure of aggregations:
 }
 --------------------------------------------------
 
-The `aggregations` object (a.k.a `aggs` for short) in the json holds the aggregations to be computed. Each aggregation
+The `aggregations` object (the key `aggs` can also be used) in the json holds the aggregations to be computed. Each aggregation
 is associated with a logical name that the user defines (e.g. if the aggregation computes the average price, then it'll
 make sense to name it `avg_price`). These logical names will also be used to uniquely identify the aggregations in the
 response. Each aggregation has a specific type (`<aggregation_type>` in the above snippet) and is typically the first

+ 6 - 7
docs/reference/search/aggregations/bucket/datehistogram-aggregation.asciidoc

@@ -3,13 +3,12 @@
 
 A multi-bucket aggregation similar to the <<search-aggregations-bucket-histogram-aggregation,histogram>> except it can
 only be applied on date values. Since dates are represented in elasticsearch internally as long values, it is possible
-to use the normal `histogram` on dates as well, though accuracy will be compromized. The reason for this is in the fact
+to use the normal `histogram` on dates as well, though accuracy will be compromised. The reason for this is in the fact
 that time based intervals are not fixed (think of leap years and on the number of days in a month). For this reason,
-we need a spcial support for time based data. From functionality perspective, this historam supports the same features
-as the normal <<search-aggregations-bucket-histogram-aggregation,histogram>>. The main difference though is that the
-interval can be specified by date/time expressions.
+we need a special support for time based data. From a functionality perspective, this histogram supports the same features
+as the normal <<search-aggregations-bucket-histogram-aggregation,histogram>>. The main difference is that the interval can be specified by date/time expressions.
 
-Requesting a month length bucket intervals
+Requesting bucket intervals of a month.
 
 [source,js]
 --------------------------------------------------
@@ -25,7 +24,7 @@ Requesting a month length bucket intervals
 }
 --------------------------------------------------
 
-or based on 1.5 months
+fractional values are allowed, for example 1.5 hours:
 
 [source,js]
 --------------------------------------------------
@@ -34,7 +33,7 @@ or based on 1.5 months
         "articles_over_time" : {
             "date_histogram" : {
                 "field" : "date",
-                "interval" : "1.5M"
+                "interval" : "1.5h"
             }
         }
     }

+ 3 - 3
docs/reference/search/aggregations/bucket/histogram-aggregation.asciidoc

@@ -1,7 +1,7 @@
 [[search-aggregations-bucket-histogram-aggregation]]
 === Histogram
 
-A multi-bucket values source based aggregation that can be applied on numeric values extracted from the documents. It dynamically builds fixed size (a.k.a. interval) buckets over the values. For example, if the documents have a field that holds a price (numeric), we can configure this aggregation to dynamically build buckets with interval `5` (in case of price it may represent $5). When the aggregation executes, the price field of every document will be evaluated and will be rounded down to its closes bucket - for example, if the price is `32` and the bucket size is `5` then the rounding will yield `30` and thus the document will "fall" into the bucket that is associated withe the key `30`. To make this more formal, here is the rounding function that is used:
+A multi-bucket values source based aggregation that can be applied on numeric values extracted from the documents. It dynamically builds fixed size (a.k.a. interval) buckets over the values. For example, if the documents have a field that holds a price (numeric), we can configure this aggregation to dynamically build buckets with interval `5` (in case of price it may represent $5). When the aggregation executes, the price field of every document will be evaluated and will be rounded down to its closest bucket - for example, if the price is `32` and the bucket size is `5` then the rounding will yield `30` and thus the document will "fall" into the bucket that is associated withe the key `30`. To make this more formal, here is the rounding function that is used:
 
 [source,java]
 --------------------------------------------------
@@ -52,7 +52,7 @@ And the following may be the response:
 }
 --------------------------------------------------
 
-The response above shows that non of the aggregated products has a price that falls within the range of `[100 - 150)`. By default, the response will only contain the non-empty buckets, though it is possible to also return those, by setting the `empty_buckets` flag to `true`:
+The response above shows that none of the aggregated products has a price that falls within the range of `[100 - 150)`. By default, the response will only contain the non-empty buckets, though it is possible to also return those, by setting the `empty_buckets` flag to `true`:
 
 [source,js]
 --------------------------------------------------
@@ -218,7 +218,7 @@ NOTE:   The special value `0` can be used to add empty buckets to the response b
 
 ==== Response Format
 
-By default, the buckets are retuned as an ordered array. It is also possilbe to request the response as a hash instead keyed by the buckets keys:
+By default, the buckets are returned as an ordered array. It is also possible to request the response as a hash instead keyed by the buckets keys:
 
 [source,js]
 --------------------------------------------------

+ 1 - 1
docs/reference/search/aggregations/bucket/missing-aggregation.asciidoc

@@ -1,7 +1,7 @@
 [[search-aggregations-bucket-missing-aggregation]]
 === Missing
 
-A field data based single bucket aggregation, that creates a bucket of all documents in the current document set context that are missing a field value (effectively, missing a field). This aggregator will often be used in conjunction with other field data bucket aggregators (such as ranges) to return information for all the documents that could not be placed in any of the other buckets due to missing field data values.
+A field data based single bucket aggregation, that creates a bucket of all documents in the current document set context that are missing a field value (effectively, missing a field or having the configured NULL value set). This aggregator will often be used in conjunction with other field data bucket aggregators (such as ranges) to return information for all the documents that could not be placed in any of the other buckets due to missing field data values.
 
 Example:
 

+ 2 - 2
docs/reference/search/aggregations/metrics/avg-aggregation.asciidoc

@@ -30,7 +30,7 @@ The above aggregation computes the average grade over all documents. The aggrega
 }
 --------------------------------------------------
 
-The name of the aggregation (`avg_grade` above) also serves as the key by which the aggreagtion result can be retrieved from the returned response.
+The name of the aggregation (`avg_grade` above) also serves as the key by which the aggregation result can be retrieved from the returned response.
 
 ==== Script
 
@@ -49,7 +49,7 @@ Computing the average grade based on a script:
 
 ===== Value Script
 
-It turned out that the exam was way above the level of the students and a grade correction needs to be applied. We can use value script to get the new average
+It turned out that the exam was way above the level of the students and a grade correction needs to be applied. We can use value script to get the new average:
 
 [source,js]
 --------------------------------------------------

+ 2 - 2
docs/reference/search/aggregations/metrics/extendedstats-aggregation.asciidoc

@@ -3,7 +3,7 @@
 
 A `multi-value` metrics aggregation that computes stats over numeric values extracted from the aggregated documents. These values can be extracted either from specific numeric fields in the documents, or be generated by a provided script.
 
-The `exteded_stats` aggregations is an extended version of the <<search-aggregations-metrics-stats-aggregation,`stats`>> aggregation, where additional metrics are added such as `sum_of_squares`, `variance` and `std_deviation`.
+The `extended_stats` aggregations is an extended version of the <<search-aggregations-metrics-stats-aggregation,`stats`>> aggregation, where additional metrics are added such as `sum_of_squares`, `variance` and `std_deviation`.
 
 Assuming the data consists of documents representing exams grades (between 0 and 100) of students
 
@@ -58,7 +58,7 @@ Computing the grades stats based on a script:
 
 ===== Value Script
 
-It turned out that the exam was way above the level of the students and a grade correction needs to be applied. We can use value script to get the new stats
+It turned out that the exam was way above the level of the students and a grade correction needs to be applied. We can use value script to get the new stats:
 
 [source,js]
 --------------------------------------------------

+ 2 - 2
docs/reference/search/aggregations/metrics/max-aggregation.asciidoc

@@ -29,7 +29,7 @@ Response:
 }
 --------------------------------------------------
 
-As can be seen, the name of the aggregation (`max_price` above) also serves as the key by which the aggreagtion result can be retrieved from the returned response.
+As can be seen, the name of the aggregation (`max_price` above) also serves as the key by which the aggregation result can be retrieved from the returned response.
 
 ==== Script
 
@@ -47,7 +47,7 @@ Computing the max price value across all document, this time using a script:
 
 ==== Value Script
 
-Let's say that the prices of the documents in our index are in USD, but we would like to compute the max in EURO (and for the sake of this example, lets say the conversion rate is 1.2). We can use a value script to apply the conversion rate to every value before it's aggregated:
+Let's say that the prices of the documents in our index are in USD, but we would like to compute the max in EURO (and for the sake of this example, lets say the conversion rate is 1.2). We can use a value script to apply the conversion rate to every value before it is aggregated:
 
 [source,js]
 --------------------------------------------------

+ 2 - 2
docs/reference/search/aggregations/metrics/min-aggregation.asciidoc

@@ -3,7 +3,7 @@
 
 A `single-value` metrics aggregation that keeps track and returns the minimum value among numeric values extracted from the aggregated documents. These values can be extracted either from specific numeric fields in the documents, or be generated by a provided script.
 
-Computing the min price value across all documents
+Computing the min price value across all documents:
 
 [source,js]
 --------------------------------------------------
@@ -47,7 +47,7 @@ Computing the min price value across all document, this time using a script:
 
 ==== Value Script
 
-Let's say that the prices of the documents in our index are in USD, but we would like to compute the min in EURO (and for the sake of this example, lets say the conversion rate is 1.2). We can use a value script to apply the conversion rate to every value before it's aggregated:
+Let's say that the prices of the documents in our index are in USD, but we would like to compute the min in EURO (and for the sake of this example, lets say the conversion rate is 1.2). We can use a value script to apply the conversion rate to every value before it is aggregated:
 
 [source,js]
 --------------------------------------------------

+ 2 - 2
docs/reference/search/aggregations/metrics/stats-aggregation.asciidoc

@@ -36,7 +36,7 @@ The above aggregation computes the grades statistics over all documents. The agg
 }
 --------------------------------------------------
 
-The name of the aggregation (`grades_stats` above) also serves as the key by which the aggreagtion result can be retrieved from the returned response.
+The name of the aggregation (`grades_stats` above) also serves as the key by which the aggregation result can be retrieved from the returned response.
 
 ==== Script
 
@@ -55,7 +55,7 @@ Computing the grades stats based on a script:
 
 ===== Value Script
 
-It turned out that the exam was way above the level of the students and a grade correction needs to be applied. We can use value script to get the new stats
+It turned out that the exam was way above the level of the students and a grade correction needs to be applied. We can use a value script to get the new stats:
 
 [source,js]
 --------------------------------------------------

+ 1 - 1
docs/reference/search/aggregations/metrics/sum-aggregation.asciidoc

@@ -38,7 +38,7 @@ The above aggregation sums up all changes in the today's trading stock ticks whi
 }
 --------------------------------------------------
 
-The name of the aggregation (`intraday_return` above) also serves as the key by which the aggreagtion result can be retrieved from the returned response.
+The name of the aggregation (`intraday_return` above) also serves as the key by which the aggregation result can be retrieved from the returned response.
 
 ==== Script