Browse Source

Docs: Mentioned script_id and script_file parameters across all aggs

Closes #10760
Clinton Gormley 10 years ago
parent
commit
f1a0e2216a

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

@@ -68,6 +68,8 @@ Some aggregations work on values extracted from the aggregated documents. Typica
 a specific document field which is set using the `field` key for the aggregations. It is also possible to define a
 <<modules-scripting,`script`>> which will generate the values (per document).
 
+TIP: The `script` parameter expects an inline script. Use `script_id` for indexed scripts and `script_file` for scripts in the `config/scripts/` directory.
+
 When both `field` and `script` settings are configured for the aggregation, the script will be treated as a
 `value script`.  While normal scripts are evaluated on a document level (i.e. the script has access to all the data
 associated with the document), value scripts are evaluated on the *value* level. In this mode, the values are extracted
@@ -129,7 +131,7 @@ See <<index-modules-shard-query-cache>> for more details.
 [float]
 === Returning only aggregation results
 
-There are many occasions when aggregations are required but search hits are not.  For these cases the hits can be ignored by 
+There are many occasions when aggregations are required but search hits are not.  For these cases the hits can be ignored by
 setting `size=0`. For example:
 
 [source,js]

+ 2 - 0
docs/reference/search/aggregations/bucket/range-aggregation.asciidoc

@@ -128,6 +128,8 @@ It is also possible to customize the key for each range:
 
 ==== Script
 
+TIP: The `script` parameter expects an inline script. Use `script_id` for indexed scripts and `script_file` for scripts in the `config/scripts/` directory.
+
 [source,js]
 --------------------------------------------------
 {

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

@@ -441,6 +441,9 @@ Generating the terms using a script:
 }
 --------------------------------------------------
 
+TIP: The `script` parameter expects an inline script. Use `script_id` for indexed scripts and `script_file` for scripts in the `config/scripts/` directory.
+
+
 ==== Value Script
 
 [source,js]

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

@@ -47,6 +47,8 @@ Computing the average grade based on a script:
 }
 --------------------------------------------------
 
+TIP: The `script` parameter expects an inline script. Use `script_id` for indexed scripts and `script_file` for scripts in the `config/scripts/` directory.
+
 ===== 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:

+ 3 - 0
docs/reference/search/aggregations/metrics/cardinality-aggregation.asciidoc

@@ -152,3 +152,6 @@ however since hashes need to be computed on the fly.
     }
 }
 --------------------------------------------------
+
+TIP: The `script` parameter expects an inline script. Use `script_id` for indexed scripts and `script_file` for scripts in the `config/scripts/` directory.
+

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

@@ -91,6 +91,8 @@ Computing the grades stats based on a script:
 }
 --------------------------------------------------
 
+TIP: The `script` parameter expects an inline script. Use `script_id` for indexed scripts and `script_file` for scripts in the `config/scripts/` directory.
+
 ===== 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:

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

@@ -44,6 +44,7 @@ Computing the max price value across all document, this time using a script:
 }
 --------------------------------------------------
 
+TIP: The `script` parameter expects an inline script. Use `script_id` for indexed scripts and `script_file` for scripts in the `config/scripts/` directory.
 
 ==== Value Script
 

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

@@ -44,6 +44,7 @@ Computing the min price value across all document, this time using a script:
 }
 --------------------------------------------------
 
+TIP: The `script` parameter expects an inline script. Use `script_id` for indexed scripts and `script_file` for scripts in the `config/scripts/` directory.
 
 ==== Value Script
 

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

@@ -113,6 +113,8 @@ a script to convert them on-the-fly:
 script to generate values which percentiles are calculated on
 <2> Scripting supports parameterized input just like any other script
 
+TIP: The `script` parameter expects an inline script. Use `script_id` for indexed scripts and `script_file` for scripts in the `config/scripts/` directory.
+
 [[search-aggregations-metrics-percentile-aggregation-approximation]]
 ==== Percentiles are (usually) approximate
 

+ 7 - 5
docs/reference/search/aggregations/metrics/percentile-rank-aggregation.asciidoc

@@ -8,16 +8,16 @@ be generated by a provided script.
 
 [NOTE]
 ==================================================
-Please see <<search-aggregations-metrics-percentile-aggregation-approximation>> 
-and <<search-aggregations-metrics-percentile-aggregation-compression>> for advice 
+Please see <<search-aggregations-metrics-percentile-aggregation-approximation>>
+and <<search-aggregations-metrics-percentile-aggregation-compression>> for advice
 regarding approximation and memory use of the percentile ranks aggregation
 ==================================================
 
-Percentile rank show the percentage of observed values which are below certain 
+Percentile rank show the percentage of observed values which are below certain
 value.  For example, if a value is greater than or equal to 95% of the observed values
 it is said to be at the 95th percentile rank.
 
-Assume your data consists of website load times.  You may have a service agreement that 
+Assume your data consists of website load times.  You may have a service agreement that
 95% of page loads completely within 15ms and 99% of page loads complete within 30ms.
 
 Let's look at a range of percentiles representing load time:
@@ -55,7 +55,7 @@ The response will look like this:
 }
 --------------------------------------------------
 
-From this information you can determine you are hitting the 99% load time target but not quite 
+From this information you can determine you are hitting the 99% load time target but not quite
 hitting the 95% load time target
 
 
@@ -84,3 +84,5 @@ a script to convert them on-the-fly:
 <1> The `field` parameter is replaced with a `script` parameter, which uses the
 script to generate values which percentile ranks are calculated on
 <2> Scripting supports parameterized input just like any other script
+
+TIP: The `script` parameter expects an inline script. Use `script_id` for indexed scripts and `script_file` for scripts in the `config/scripts/` directory.

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

@@ -53,6 +53,8 @@ Computing the grades stats based on a script:
 }
 --------------------------------------------------
 
+TIP: The `script` parameter expects an inline script. Use `script_id` for indexed scripts and `script_file` for scripts in the `config/scripts/` directory.
+
 ===== 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 a value script to get the new stats:

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

@@ -55,6 +55,8 @@ Computing the intraday return based on a script:
 }
 --------------------------------------------------
 
+TIP: The `script` parameter expects an inline script. Use `script_id` for indexed scripts and `script_file` for scripts in the `config/scripts/` directory.
+
 ===== Value Script
 
 Computing the sum of squares over all stock tick changes:

+ 3 - 0
docs/reference/search/aggregations/metrics/valuecount-aggregation.asciidoc

@@ -34,6 +34,7 @@ The name of the aggregation (`grades_count` above) also serves as the key by whi
 retrieved from the returned response.
 
 ==== Script
+
 Counting the values generated by a script:
 
 [source,js]
@@ -46,3 +47,5 @@ Counting the values generated by a script:
     }
 }
 --------------------------------------------------
+
+TIP: The `script` parameter expects an inline script. Use `script_id` for indexed scripts and `script_file` for scripts in the `config/scripts/` directory.