Skip to content

Commit 07e7a2c

Browse files
committed
fixing errors
1 parent ff97ca0 commit 07e7a2c

10 files changed

+116
-177
lines changed

docs/reference/data-analysis/aggregations/search-aggregations-bucket-diversified-sampler-aggregation.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,11 @@ Response:
8080
}
8181
}
8282
```
83-
% TESTRESPONSE[s/.../"took": $body.took,"timed_out": false,"_shards": $body._shards,"hits": $body.hits,/]
84-
% TESTRESPONSE[s/2.213/$body.aggregations.my_unbiased_sample.keywords.buckets.0.score/]
8583

8684
1. 151 documents were sampled in total.
8785
2. The results of the significant_terms aggregation are not skewed by any single author’s quirks because we asked for a maximum of one post from any one author in our sample.
88-
86+
% TESTRESPONSE[s/.../"took": $body.took,"timed_out": false,"_shards": $body._shards,"hits": $body.hits,/]
87+
% TESTRESPONSE[s/2.213/$body.aggregations.my_unbiased_sample.keywords.buckets.0.score/]
8988

9089
## Scripted example [_scripted_example]
9190

docs/reference/data-analysis/aggregations/search-aggregations-pipeline-derivative-aggregation.md

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,9 @@ POST /sales/_search
5959
}
6060
}
6161
```
62-
% TEST[setup:sales]
6362

6463
1. `buckets_path` instructs this derivative aggregation to use the output of the `sales` aggregation for the derivative
65-
64+
% TEST[setup:sales]
6665

6766
And the following may be the response:
6867

@@ -110,14 +109,13 @@ And the following may be the response:
110109
}
111110
}
112111
```
113-
% TESTRESPONSE[s/"took": 11/"took": $body.took/]
114-
% TESTRESPONSE[s/"_shards": .../"_shards": $body._shards/]
115-
% TESTRESPONSE[s/"hits": .../"hits": $body.hits/]
116112

117113
1. No derivative for the first bucket since we need at least 2 data points to calculate the derivative
118114
2. Derivative value units are implicitly defined by the `sales` aggregation and the parent histogram so in this case the units would be $/month assuming the `price` field has units of $.
119115
3. The number of documents in the bucket are represented by the `doc_count`
120-
116+
% TESTRESPONSE[s/"took": 11/"took": $body.took/]
117+
% TESTRESPONSE[s/"_shards": .../"_shards": $body._shards/]
118+
% TESTRESPONSE[s/"hits": .../"hits": $body.hits/]
121119

122120

123121
## Second Order Derivative [_second_order_derivative]
@@ -155,10 +153,9 @@ POST /sales/_search
155153
}
156154
}
157155
```
158-
% TEST[setup:sales]
159156

160157
1. `buckets_path` for the second derivative points to the name of the first derivative
161-
158+
% TEST[setup:sales]
162159

163160
And the following may be the response:
164161

@@ -209,13 +206,12 @@ And the following may be the response:
209206
}
210207
}
211208
```
209+
210+
1. No second derivative for the first two buckets since we need at least 2 data points from the first derivative to calculate the second derivative
212211
% TESTRESPONSE[s/"took": 50/"took": $body.took/]
213212
% TESTRESPONSE[s/"_shards": .../"_shards": $body._shards/]
214213
% TESTRESPONSE[s/"hits": .../"hits": $body.hits/]
215214

216-
1. No second derivative for the first two buckets since we need at least 2 data points from the first derivative to calculate the second derivative
217-
218-
219215

220216
## Units [_units]
221217

@@ -248,10 +244,9 @@ POST /sales/_search
248244
}
249245
}
250246
```
251-
% TEST[setup:sales]
252247

253248
1. `unit` specifies what unit to use for the x-axis of the derivative calculation
254-
249+
% TEST[setup:sales]
255250

256251
And the following may be the response:
257252

@@ -301,12 +296,11 @@ And the following may be the response:
301296
}
302297
}
303298
```
304-
% TESTRESPONSE[s/"took": 50/"took": $body.took/]
305-
% TESTRESPONSE[s/"_shards": .../"_shards": $body._shards/]
306-
% TESTRESPONSE[s/"hits": .../"hits": $body.hits/]
307299

308300
1. `value` is reported in the original units of *per month*
309301
2. `normalized_value` is reported in the desired units of *per day*
310-
302+
% TESTRESPONSE[s/"took": 50/"took": $body.took/]
303+
% TESTRESPONSE[s/"_shards": .../"_shards": $body._shards/]
304+
% TESTRESPONSE[s/"hits": .../"hits": $body.hits/]
311305

312306

docs/reference/data-analysis/aggregations/search-aggregations-pipeline-max-bucket-aggregation.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,9 @@ POST /sales/_search
5858
}
5959
}
6060
```
61-
% TEST[setup:sales]
6261

6362
1. `buckets_path` instructs this max_bucket aggregation that we want the maximum value of the `sales` aggregation in the `sales_per_month` date histogram.
64-
63+
% TEST[setup:sales]
6564

6665
And the following may be the response:
6766

@@ -107,11 +106,11 @@ And the following may be the response:
107106
}
108107
}
109108
```
109+
110+
1. `keys` is an array of strings since the maximum value may be present in multiple buckets
110111
% TESTRESPONSE[s/"took": 11/"took": $body.took/]
111112
% TESTRESPONSE[s/"_shards": .../"_shards": $body._shards/]
112113
% TESTRESPONSE[s/"hits": .../"hits": $body.hits/]
113114

114-
1. `keys` is an array of strings since the maximum value may be present in multiple buckets
115-
116115

117116

docs/reference/data-analysis/aggregations/search-aggregations-pipeline-min-bucket-aggregation.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,9 @@ POST /sales/_search
5858
}
5959
}
6060
```
61-
% TEST[setup:sales]
6261

6362
1. `buckets_path` instructs this min_bucket aggregation that we want the minimum value of the `sales` aggregation in the `sales_per_month` date histogram.
64-
63+
% TEST[setup:sales]
6564

6665
And the following may be the response:
6766

@@ -107,11 +106,10 @@ And the following may be the response:
107106
}
108107
}
109108
```
109+
110+
1. `keys` is an array of strings since the minimum value may be present in multiple buckets
110111
% TESTRESPONSE[s/"took": 11/"took": $body.took/]
111112
% TESTRESPONSE[s/"_shards": .../"_shards": $body._shards/]
112113
% TESTRESPONSE[s/"hits": .../"hits": $body.hits/]
113114

114-
1. `keys` is an array of strings since the minimum value may be present in multiple buckets
115-
116-
117115

0 commit comments

Comments
 (0)