Skip to content

Commit c64883c

Browse files
committed
code sample updates
1 parent b1d93c9 commit c64883c

File tree

261 files changed

+1490
-1490
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

261 files changed

+1490
-1490
lines changed

docs/reference/aggregations/pipeline.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ POST /_search
102102
}
103103
}
104104
```
105-
% TEST[setup:sales]
105+
% TEST[setup:sales]
106106

107107
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.
108108

@@ -147,7 +147,7 @@ POST /_search
147147
}
148148
}
149149
```
150-
% TEST[setup:sales]
150+
% TEST[setup:sales]
151151

152152
1. `buckets_path` selects the hats and bags buckets (via `['hat']`/`['bag']``) to use in the script specifically, instead of fetching all the buckets from `sale_type` aggregation
153153

@@ -216,7 +216,7 @@ POST /sales/_search
216216
}
217217
}
218218
```
219-
% TEST[setup:sales]
219+
% TEST[setup:sales]
220220

221221
1. By using `_bucket_count` instead of a metric name, we can filter out `histo` buckets where they contain no buckets for the `categories` aggregation
222222

@@ -229,7 +229,7 @@ An alternate syntax is supported to cope with aggregations or metrics which have
229229
```js
230230
"buckets_path": "my_percentile[99.9]"
231231
```
232-
% NOTCONSOLE
232+
% NOTCONSOLE
233233

234234

235235
## Dealing with gaps in the data [gap-policy]

docs/reference/aggregations/search-aggregations-bucket-adjacency-matrix-aggregation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ The response contains buckets with document counts for each filter and combinati
8787
}
8888
}
8989
```
90-
% TESTRESPONSE[s/"took": 9/"took": $body.took/]
91-
% TESTRESPONSE[s/"_shards": .../"_shards": $body._shards/]
92-
% TESTRESPONSE[s/"hits": .../"hits": $body.hits/]
90+
% TESTRESPONSE[s/"took": 9/"took": $body.took/]
91+
% TESTRESPONSE[s/"_shards": .../"_shards": $body._shards/]
92+
% TESTRESPONSE[s/"hits": .../"hits": $body.hits/]
9393

9494

9595
## Parameters [adjacency-matrix-agg-params]

docs/reference/aggregations/search-aggregations-bucket-autodatehistogram-aggregation.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ POST /sales/_search?size=0
2828
}
2929
}
3030
```
31-
% TEST[setup:sales]
31+
% TEST[setup:sales]
3232

3333
## Keys [_keys]
3434

@@ -55,7 +55,7 @@ POST /sales/_search?size=0
5555
}
5656
}
5757
```
58-
% TEST[setup:sales]
58+
% TEST[setup:sales]
5959

6060
1. Supports expressive date [format pattern](/reference/aggregations/search-aggregations-bucket-daterange-aggregation.md#date-format-pattern)
6161

@@ -89,7 +89,7 @@ Response:
8989
}
9090
}
9191
```
92-
% TESTRESPONSE[s/.../"took": $body.took,"timed_out": false,"_shards": $body._shards,"hits": $body.hits,/]
92+
% TESTRESPONSE[s/.../"took": $body.took,"timed_out": false,"_shards": $body._shards,"hits": $body.hits,/]
9393

9494

9595
## Intervals [_intervals]
@@ -185,7 +185,7 @@ UTC is used if no time zone is specified, three 1-hour buckets are returned star
185185
}
186186
}
187187
```
188-
% TESTRESPONSE[s/.../"took": $body.took,"timed_out": false,"_shards": $body._shards,"hits": $body.hits,/]
188+
% TESTRESPONSE[s/.../"took": $body.took,"timed_out": false,"_shards": $body._shards,"hits": $body.hits,/]
189189

190190
If a `time_zone` of `-01:00` is specified, then midnight starts at one hour before midnight UTC:
191191

@@ -203,7 +203,7 @@ GET my-index-000001/_search?size=0
203203
}
204204
}
205205
```
206-
% TEST[continued]
206+
% TEST[continued]
207207

208208
Now three 1-hour buckets are still returned but the first bucket starts at 11:00pm on 30 September 2015 since that is the local time for the bucket in the specified time zone.
209209

@@ -234,7 +234,7 @@ Now three 1-hour buckets are still returned but the first bucket starts at 11:00
234234
}
235235
}
236236
```
237-
% TESTRESPONSE[s/.../"took": $body.took,"timed_out": false,"_shards": $body._shards,"hits": $body.hits,/]
237+
% TESTRESPONSE[s/.../"took": $body.took,"timed_out": false,"_shards": $body._shards,"hits": $body.hits,/]
238238

239239
1. The `key_as_string` value represents midnight on each day in the specified time zone.
240240

@@ -274,7 +274,7 @@ POST /sales/_search?size=0
274274
}
275275
}
276276
```
277-
% TEST[setup:sales]
277+
% TEST[setup:sales]
278278

279279

280280
## Missing value [_missing_value]
@@ -297,7 +297,7 @@ POST /sales/_search?size=0
297297
}
298298
}
299299
```
300-
% TEST[setup:sales]
300+
% TEST[setup:sales]
301301

302302
1. Documents without a value in the `publish_date` field will fall into the same bucket as documents that have the value `2000-01-01`.
303303

docs/reference/aggregations/search-aggregations-bucket-categorize-text-aggregation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ POST log-messages/_search?filter_path=aggregations
107107
}
108108
}
109109
```
110-
% TEST[setup:categorize_text]
110+
% TEST[setup:categorize_text]
111111

112112
Response:
113113

@@ -161,7 +161,7 @@ POST log-messages/_search?filter_path=aggregations
161161
}
162162
}
163163
```
164-
% TEST[setup:categorize_text]
164+
% TEST[setup:categorize_text]
165165

166166
1. The filters to apply to the analyzed tokens. It filters out tokens like `bar_123`.
167167

@@ -219,7 +219,7 @@ POST log-messages/_search?filter_path=aggregations
219219
}
220220
}
221221
```
222-
% TEST[setup:categorize_text]
222+
% TEST[setup:categorize_text]
223223

224224
1. The filters to apply to the analyzed tokens. It filters out tokens like `bar_123`.
225225
2. Require 11% of token weight to match before adding a message to an existing category rather than creating a new one.
@@ -282,7 +282,7 @@ POST log-messages/_search?filter_path=aggregations
282282
}
283283
}
284284
```
285-
% TEST[setup:categorize_text]
285+
% TEST[setup:categorize_text]
286286

287287
```console-result
288288
{

docs/reference/aggregations/search-aggregations-bucket-children-aggregation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ PUT child_example/_doc/1
5252
]
5353
}
5454
```
55-
% TEST[continued]
55+
% TEST[continued]
5656

5757
Examples of `answer` documents:
5858

@@ -87,7 +87,7 @@ PUT child_example/_doc/3?routing=1&refresh
8787
"creation_date": "2009-05-05T13:45:37.030"
8888
}
8989
```
90-
% TEST[continued]
90+
% TEST[continued]
9191

9292
The following request can be built that connects the two together:
9393

@@ -119,7 +119,7 @@ POST child_example/_search?size=0
119119
}
120120
}
121121
```
122-
% TEST[continued]
122+
% TEST[continued]
123123

124124
1. The `type` points to type / mapping with the name `answer`.
125125

@@ -219,7 +219,7 @@ Possible response:
219219
}
220220
}
221221
```
222-
% TESTRESPONSE[s/"took": 25/"took": $body.took/]
222+
% TESTRESPONSE[s/"took": 25/"took": $body.took/]
223223

224224
1. The number of question documents with the tag `file-transfer`, `windows-server-2003`, etc.
225225
2. The number of answer documents that are related to question documents with the tag `file-transfer`, `windows-server-2003`, etc.

docs/reference/aggregations/search-aggregations-bucket-composite-aggregation.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ For example, consider the following document:
2626
"number": [23, 65, 76]
2727
}
2828
```
29-
% NOTCONSOLE
29+
% NOTCONSOLE
3030

3131
Using `keyword` and `number` as source fields for the aggregation results in the following composite buckets:
3232

@@ -38,7 +38,7 @@ Using `keyword` and `number` as source fields for the aggregation results in the
3838
{ "keyword": "bar", "number": 65 }
3939
{ "keyword": "bar", "number": 76 }
4040
```
41-
% NOTCONSOLE
41+
% NOTCONSOLE
4242

4343
## Value sources [_value_sources]
4444

@@ -312,7 +312,7 @@ Instead of a single bucket starting at midnight, the above request groups the do
312312
}
313313
}
314314
```
315-
% TESTRESPONSE[s/.../"took": $body.took,"timed_out": false,"_shards": $body._shards,"hits": $body.hits,/]
315+
% TESTRESPONSE[s/.../"took": $body.took,"timed_out": false,"_shards": $body._shards,"hits": $body.hits,/]
316316

317317
::::{note}
318318
The start `offset` of each bucket is calculated after `time_zone` adjustments have been made.
@@ -516,7 +516,7 @@ GET /_search
516516
}
517517
}
518518
```
519-
% TEST[s/_search/_search?filter_path=aggregations/]
519+
% TEST[s/_search/_search?filter_path=aggregations/]
520520

521521
... returns:
522522

@@ -549,7 +549,7 @@ GET /_search
549549
}
550550
}
551551
```
552-
% TESTRESPONSE[s/...//]
552+
% TESTRESPONSE[s/...//]
553553

554554
To get the next set of buckets, resend the same aggregation with the `after` parameter set to the `after_key` value returned in the response. For example, this request uses the `after_key` value provided in the previous response:
555555

@@ -714,7 +714,7 @@ GET /_search
714714
}
715715
}
716716
```
717-
% TEST[s/_search/_search?filter_path=aggregations/]
717+
% TEST[s/_search/_search?filter_path=aggregations/]
718718

719719
... returns:
720720

@@ -773,7 +773,7 @@ GET /_search
773773
}
774774
}
775775
```
776-
% TESTRESPONSE[s/...//]
776+
% TESTRESPONSE[s/...//]
777777

778778

779779
## Pipeline aggregations [search-aggregations-bucket-composite-aggregation-pipeline-aggregations]

docs/reference/aggregations/search-aggregations-bucket-correlation-aggregation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ A `bucket_correlation` aggregation looks like this in isolation:
5858
}
5959
}
6060
```
61-
% NOTCONSOLE
61+
% NOTCONSOLE
6262

6363
1. The buckets containing the values to correlate against.
6464
2. The correlation function definition.
@@ -117,7 +117,7 @@ POST correlate_latency/_search?size=0&filter_path=aggregations
117117
}
118118
}
119119
```
120-
% TEST[setup:correlate_latency]
120+
% TEST[setup:correlate_latency]
121121

122122
1. The term buckets containing a range aggregation and the bucket correlation aggregation. Both are utilized to calculate the correlation of the term values with the latency.
123123
2. The range aggregation on the latency field. The ranges were created referencing the percentiles of the latency field.

docs/reference/aggregations/search-aggregations-bucket-count-ks-test-aggregation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ A `bucket_count_ks_test` aggregation looks like this in isolation:
3737
}
3838
}
3939
```
40-
% NOTCONSOLE
40+
% NOTCONSOLE
4141

4242
1. The buckets containing the values to test against.
4343
2. The alternatives to calculate.
@@ -90,7 +90,7 @@ POST correlate_latency/_search?size=0&filter_path=aggregations
9090
}
9191
}
9292
```
93-
% TEST[setup:correlate_latency]
93+
% TEST[setup:correlate_latency]
9494

9595
1. The term buckets containing a range aggregation and the bucket correlation aggregation. Both are utilized to calculate the correlation of the term values with the latency.
9696
2. The range aggregation on the latency field. The ranges were created referencing the percentiles of the latency field.

0 commit comments

Comments
 (0)