Skip to content

Commit d4a3dfe

Browse files
Fixed a badly formatted example
1 parent cf396b2 commit d4a3dfe

File tree

7 files changed

+68
-38
lines changed

7 files changed

+68
-38
lines changed

output/openapi/elasticsearch-openapi.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/openapi/elasticsearch-serverless-openapi.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/schema.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/eql/search/examples/request/EqlSearchRequestExample2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ alternatives:
5151
]\\n [ process where stringContains(process.executable, \\\"regsvr32\\\") ]\\n \"}'
5252
\"$ELASTICSEARCH_URL/my-data-stream/_eql/search\""
5353
- language: Java
54-
code: |
54+
code: >
5555
client.eql().search(s -> s
5656
.index("my-data-stream")
5757
.query(" sequence by process.pid [ file where file.name == \"cmd.exe\" and process.pid != 2013 ][ process where stringContains(process.executable, \"regsvr32\") ] ")

specification/esql/query/examples/request/QueryRequestExample1.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ alternatives:
4949
library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n |
5050
SORT year\\n | LIMIT 5\\n \",\"include_ccs_metadata\":true}' \"$ELASTICSEARCH_URL/_query\""
5151
- language: Java
52-
code: |
52+
code: >
5353
client.esql().query(q -> q
5454
.includeCcsMetadata(true)
5555
.query(" FROM library,remote-*:library | EVAL year = DATE_TRUNC(1 YEARS, release_date) | STATS MAX(page_count) BY year | SORT year | LIMIT 5 ")

specification/indices/put_settings/examples/request/indicesPutSettingsRequestExample3.yaml

Lines changed: 57 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,41 @@ summary: Update index analysis
22
method_request: POST /my-index-000001/_close
33
description: To add an analyzer, you must close the index, define the analyzer, then reopen the index.
44
# type: request
5-
value: "{
6-
7-
\ \"analysis\" : {
8-
9-
\ \"analyzer\":{
10-
11-
\ \"content\":{
12-
13-
\ \"type\":\"custom\",
14-
15-
\ \"tokenizer\":\"whitespace\"
16-
17-
\ }
18-
19-
\ }
20-
21-
\ }
22-
5+
value: |-
6+
PUT /my-index-000001/_settings
7+
{
8+
"analysis": {
9+
"analyzer": {
10+
"content": {
11+
"type": "custom",
12+
"tokenizer": "whitespace"
13+
}
14+
}
15+
}
2316
}
24-
25-
26-
POST /my-index-000001/_open"
17+
POST /my-index-000001/_open
2718
alternatives:
2819
- language: Python
2920
code: |-
3021
resp = client.indices.close(
3122
index="my-index-000001",
3223
)
3324
34-
resp1 = client.indices.open(
25+
resp1 = client.indices.put_settings(
26+
index="my-index-000001",
27+
settings={
28+
"analysis": {
29+
"analyzer": {
30+
"content": {
31+
"type": "custom",
32+
"tokenizer": "whitespace"
33+
}
34+
}
35+
}
36+
},
37+
)
38+
39+
resp2 = client.indices.open(
3540
index="my-index-000001",
3641
)
3742
- language: JavaScript
@@ -40,12 +45,30 @@ alternatives:
4045
index: "my-index-000001",
4146
});
4247
43-
const response1 = await client.indices.open({
48+
const response1 = await client.indices.putSettings({
49+
index: "my-index-000001",
50+
settings: {
51+
analysis: {
52+
analyzer: {
53+
content: {
54+
type: "custom",
55+
tokenizer: "whitespace",
56+
},
57+
},
58+
},
59+
},
60+
});
61+
62+
const response2 = await client.indices.open({
4463
index: "my-index-000001",
4564
});
4665
- language: Ruby
4766
code: |-
4867
response = client.indices.close(
68+
index: "my-index-000001"
69+
)
70+
71+
response1 = client.indices.put_settings(
4972
index: "my-index-000001",
5073
body: {
5174
"analysis": {
@@ -59,13 +82,17 @@ alternatives:
5982
}
6083
)
6184
62-
response1 = client.indices.open(
85+
response2 = client.indices.open(
6386
index: "my-index-000001"
6487
)
6588
- language: PHP
6689
code: |-
6790
$resp = $client->indices()->close([
6891
"index" => "my-index-000001",
92+
]);
93+
94+
$resp1 = $client->indices()->putSettings([
95+
"index" => "my-index-000001",
6996
"body" => [
7097
"analysis" => [
7198
"analyzer" => [
@@ -78,12 +105,15 @@ alternatives:
78105
],
79106
]);
80107
81-
$resp1 = $client->indices()->open([
108+
$resp2 = $client->indices()->open([
82109
"index" => "my-index-000001",
83110
]);
84111
- language: curl
85112
code: >-
86-
curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d
87-
'{"analysis":{"analyzer":{"content":{"type":"custom","tokenizer":"whitespace"}}}}' "$ELASTICSEARCH_URL/my-index-000001/_close"
113+
curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_close"
114+
115+
curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d
116+
'{"analysis":{"analyzer":{"content":{"type":"custom","tokenizer":"whitespace"}}}}'
117+
"$ELASTICSEARCH_URL/my-index-000001/_settings"
88118
89119
curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_open"

specification/ml/infer_trained_model/examples/request/MlInferTrainedModelExample1.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ alternatives:
5555
''{"docs":[{"text":"The fool doth think he is wise, but the wise man knows himself to be a fool."}]}''
5656
"$ELASTICSEARCH_URL/_ml/trained_models/lang_ident_model_1/_infer"'
5757
- language: Java
58-
code: |
58+
code: >
5959
client.ml().inferTrainedModel(i -> i
6060
.docs(Map.of("text", JsonData.fromJson("\"The fool doth think he is wise, but the wise man knows himself to be a fool.\"")))
6161
.modelId("lang_ident_model_1")

0 commit comments

Comments
 (0)