Skip to content

Commit bf150cd

Browse files
committed
more sample snippet fixes
1 parent 3a1f806 commit bf150cd

36 files changed

+551
-70
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ POST child_example/_search?size=0
119119
}
120120
}
121121
```
122+
% TEST[continued]
122123

123124
1. The `type` points to type / mapping with the name `answer`.
124125

docs/reference/aggregations/search-aggregations-metrics-extendedstats-aggregation.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,9 @@ GET /exams/_search
145145
}
146146
}
147147
```
148+
% TEST[setup:exams]
148149

149150
1. Documents without a value in the `grade` field will fall into the same bucket as documents that have the value `0`.
150-
% TEST[setup:exams]
151+
151152

152153

docs/reference/elasticsearch/index-lifecycle-actions/ilm-rollover.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ PUT _ilm/policy/my_policy
151151
}
152152
}
153153
```
154-
154+
% TEST[skip: deprecated]
155155

156156
### Roll over based on document count [_roll_over_based_on_document_count]
157157

@@ -241,7 +241,7 @@ PUT _ilm/policy/my_policy
241241
}
242242
}
243243
```
244-
244+
% TEST[skip: max_size deprecated]
245245

246246
### Roll over while maintaining shard sizes [_roll_over_while_maintaining_shard_sizes]
247247

@@ -295,6 +295,6 @@ PUT /_ilm/policy/rollover_policy
295295
}
296296
}
297297
```
298-
298+
% TEST[skip: max_size deprecated]
299299

300300

docs/reference/elasticsearch/mapping-reference/flattened.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ For example, consider the following flattened field `flattened`:
391391
}
392392
}
393393
```
394+
% TEST[skip:backporting-from-new-docs]
394395

395396
Because `"foo.bar": "10"` is implicitly equivalent to `"foo": { "bar": "10" }`,
396397
`"bar"` has both a scalar value `"10"`, and an object value of `{ "baz": "20" }`.
@@ -408,3 +409,4 @@ For example, if the field is defined in an index configured with synthetic sourc
408409
}
409410
}
410411
```
412+
% TEST[skip:backporting-from-new-docs]

docs/reference/elasticsearch/mapping-reference/semantic-text.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ PUT my-index-000001
6060
}
6161
}
6262
```
63+
% TEST[skip:Requires inference endpoint]
6364

6465
### Using a custom endpoint
6566

docs/reference/elasticsearch/rest-apis/api-conventions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ GET remote-cluster:logs-*-*::failures/_search
456456
GET *::data,*::failures,-logs-rdbms-*::failures/_stats
457457
GET <logs-{now/d}>::failures/_search
458458
```
459-
459+
% TEST[skip:backport]
460460

461461
## Parameters [api-conventions-parameters]
462462

docs/reference/elasticsearch/rest-apis/find-text-structure-examples.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ The next example shows how it's possible to find the structure of some New York
1414
```
1515
curl -s "s3.amazonaws.com/nyc-tlc/trip+data/yellow_tripdata_2018-06.csv" | head -20000 | curl -s -H "Content-Type: application/json" -XPOST "localhost:9200/_text_structure/find_structure?pretty&lines_to_sample=20000" -T -
1616
```
17-
1817
% NOTCONSOLE
1918
% Not converting to console because this shows how curl can be used
2019

@@ -306,7 +305,6 @@ If the request does not encounter errors, you receive the following result:
306305
}
307306
}
308307
```
309-
310308
% NOTCONSOLE
311309

312310
1. `num_messages_analyzed` is 2 lower than `num_lines_analyzed` because only data records count as messages. The first line contains the column names and in this sample the second line is blank.
@@ -327,7 +325,6 @@ If you try to analyze a lot of data then the analysis will take a long time. If
327325
```
328326
curl -s "s3.amazonaws.com/nyc-tlc/trip+data/yellow_tripdata_2018-06.csv" | head -200000 | curl -s -H "Content-Type: application/json" -XPOST "localhost:9200/_text_structure/find_structure?pretty&lines_to_sample=200000&timeout=1s" -T -
329327
```
330-
331328
% NOTCONSOLE
332329
% Not converting to console because this shows how curl can be used
333330

@@ -348,7 +345,6 @@ Unless you are using an incredibly fast computer you'll receive a timeout error:
348345
"status" : 500
349346
}
350347
```
351-
352348
% NOTCONSOLE
353349

354350
::::{note}
@@ -363,7 +359,6 @@ This is an example of analyzing an {{es}} log file:
363359
curl -s -H "Content-Type: application/json" -XPOST
364360
"localhost:9200/_text_structure/find_structure?pretty&ecs_compatibility=disabled" -T "$ES_HOME/logs/elasticsearch.log"
365361
```
366-
367362
% NOTCONSOLE
368363
% Not converting to console because this shows how curl can be used
369364

@@ -498,7 +493,6 @@ If the request does not encounter errors, the result will look something like th
498493
}
499494
}
500495
```
501-
502496
% NOTCONSOLE
503497

504498
1. This time the `format` has been identified as `semi_structured_text`.
@@ -515,7 +509,6 @@ In the case of the {{es}} log a more complete Grok pattern is `\[%{TIMESTAMP_ISO
515509
```
516510
curl -s -H "Content-Type: application/json" -XPOST "localhost:9200/_text_structure/find_structure?pretty&format=semi_structured_text&grok_pattern=%5C%5B%25%7BTIMESTAMP_ISO8601:timestamp%7D%5C%5D%5C%5B%25%7BLOGLEVEL:loglevel%7D%20*%5C%5D%5C%5B%25%7BJAVACLASS:class%7D%20*%5C%5D%20%5C%5B%25%7BHOSTNAME:node%7D%5C%5D%20%25%7BJAVALOGMESSAGE:message%7D" -T "$ES_HOME/logs/elasticsearch.log"
517511
```
518-
519512
% NOTCONSOLE
520513
% Not converting to console because this shows how curl can be used
521514

@@ -758,7 +751,6 @@ If the request does not encounter errors, the result will look something like th
758751
}
759752
}
760753
```
761-
762754
% NOTCONSOLE
763755

764756
1. The `grok_pattern` in the output is now the overridden one supplied in the query parameter.

docs/reference/elasticsearch/rest-apis/index-disk-usage.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ The API returns:
122122
}
123123
}
124124
```
125-
126125
% TESTRESPONSE[s/: \{\.\.\.\}/: $body.$_path/]
127126
% TESTRESPONSE[s/: (\-)?[0-9]+/: $body.$_path/]
128127
% TESTRESPONSE[s/: "[^"]*"/: $body.$_path/]

docs/reference/elasticsearch/rest-apis/query-api-keys.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,12 @@ POST /_security/api_key
212212
A successful call returns a JSON structure that provides API key information. For example:
213213

214214
```console-result
215+
{
215216
"id": "VuaCfGcBCdbkQm-e5aOx",
216217
"name": "application-key-1",
217218
"api_key": "ui2lp2axTNmsyakw9tvNnw",
218219
"encoded": "VnVhQ2ZHY0JDZGJrUW0tZTVhT3g6dWkybHAyYXhUTm1zeWFrdzl0dk5udw=="
220+
}
219221
```
220222
% TESTRESPONSE[s/VuaCfGcBCdbkQm-e5aOx/$body.id/]
221223
% TESTRESPONSE[s/ui2lp2axTNmsyakw9tvNnw/$body.api_key/]

docs/reference/elasticsearch/rest-apis/reindex-indices.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ POST _reindex
597597
{
598598
"source": {
599599
"remote": {
600-
"host": "&lt;OTHER_HOST_URL>",
600+
"host": "<OTHER_HOST_URL>",
601601
"username": "user",
602602
"password": "pass"
603603
},
@@ -615,7 +615,7 @@ POST _reindex
615615
```
616616
% TEST[setup:host]
617617
% TEST[s/^/PUT my-index-000001\n/]
618-
% TEST[s/otherhost:9200",/\${host}",/]
618+
% TEST[s/"host": [^}]*,/"host": "http:\/\/\${host}",/]
619619
% TEST[s/"username": "user",/"username": "test_admin",/]
620620
% TEST[s/"password": "pass"/"password": "x-pack-test-password"/]
621621

@@ -638,8 +638,8 @@ POST _reindex
638638
{
639639
"source": {
640640
"remote": {
641-
"host": "&lt;OTHER_HOST_URL>",
642-
"api_key": "&lt;API_KEY_VALUE>"
641+
"host": "<OTHER_HOST_URL>",
642+
"api_key": "<API_KEY_VALUE>"
643643
},
644644
"index": "my-index-000001",
645645
"query": {
@@ -655,7 +655,7 @@ POST _reindex
655655
```
656656
% TEST[setup:host]
657657
% TEST[s/^/PUT my-index-000001\n/]
658-
% TEST[s/otherhost:9200",/\${host}",/]
658+
% TEST[s/"host": [^}]*,/"host": "http:\/\/\${host}",/]
659659
% TEST[s/"headers": \{[^}]*\}/"username": "test_admin", "password": "x-pack-test-password"/]
660660
:::
661661

@@ -665,9 +665,9 @@ POST _reindex
665665
{
666666
"source": {
667667
"remote": {
668-
"host": "&lt;OTHER_HOST_URL>",
668+
"host": "<OTHER_HOST_URL>",
669669
"headers": {
670-
"Authorization": "ApiKey &lt;API_KEY_VALUE>"
670+
"Authorization": "<API_KEY_VALUE>"
671671
}
672672
},
673673
"index": "my-index-000001",
@@ -684,7 +684,7 @@ POST _reindex
684684
```
685685
% TEST[setup:host]
686686
% TEST[s/^/PUT my-index-000001\n/]
687-
% TEST[s/otherhost:9200",/\${host}",/]
687+
% TEST[s/"host": [^}]*,/"host": "http:\/\/\${host}",/]
688688
% TEST[s/"headers": \{[^}]*\}/"username": "test_admin", "password": "x-pack-test-password"/]
689689
:::
690690

@@ -727,7 +727,7 @@ POST _reindex
727727
{
728728
"source": {
729729
"remote": {
730-
"host": "&lt;OTHER_HOST_URL>",
730+
"host": "<OTHER_HOST_URL>",
731731
...
732732
},
733733
"index": "source",
@@ -745,7 +745,7 @@ POST _reindex
745745
```
746746
% TEST[setup:host]
747747
% TEST[s/^/PUT source\n/]
748-
% TEST[s/otherhost:9200/\${host}/]
748+
% TEST[s/"host": [^}]*,/"host": "http:\/\/\${host}",/]
749749
% TEST[s/\.\.\./"username": "test_admin", "password": "x-pack-test-password"/]
750750

751751
It is also possible to set the socket read timeout on the remote connection with the `socket_timeout` field and the connection timeout with the `connect_timeout` field.
@@ -757,7 +757,7 @@ POST _reindex
757757
{
758758
"source": {
759759
"remote": {
760-
"host": "&lt;OTHER_HOST_URL>",
760+
"host": "<OTHER_HOST_URL>",
761761
...,
762762
"socket_timeout": "1m",
763763
"connect_timeout": "10s"
@@ -776,7 +776,7 @@ POST _reindex
776776
```
777777
% TEST[setup:host]
778778
% TEST[s/^/PUT source\n/]
779-
% TEST[s/otherhost:9200/\${host}/]
779+
% TEST[s/"host": [^}]*,/"host": "http:\/\/\${host}",/]
780780
% TEST[s/\.\.\.,/"username": "test_admin", "password": "x-pack-test-password",/]
781781

782782
### Configuring SSL parameters [reindex-ssl]

0 commit comments

Comments
 (0)