Skip to content

Fixed a badly formatted example #4851

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 14, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion output/openapi/elasticsearch-openapi.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion output/openapi/elasticsearch-serverless-openapi.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions output/schema/schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ alternatives:
]\\n [ process where stringContains(process.executable, \\\"regsvr32\\\") ]\\n \"}'
\"$ELASTICSEARCH_URL/my-data-stream/_eql/search\""
- language: Java
code: |
code: >
client.eql().search(s -> s
.index("my-data-stream")
.query(" sequence by process.pid [ file where file.name == \"cmd.exe\" and process.pid != 2013 ][ process where stringContains(process.executable, \"regsvr32\") ] ")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ alternatives:
library,remote-*:library\\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\\n | STATS MAX(page_count) BY year\\n |
SORT year\\n | LIMIT 5\\n \",\"include_ccs_metadata\":true}' \"$ELASTICSEARCH_URL/_query\""
- language: Java
code: |
code: >
client.esql().query(q -> q
.includeCcsMetadata(true)
.query(" FROM library,remote-*:library | EVAL year = DATE_TRUNC(1 YEARS, release_date) | STATS MAX(page_count) BY year | SORT year | LIMIT 5 ")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,41 @@ summary: Update index analysis
method_request: POST /my-index-000001/_close
description: To add an analyzer, you must close the index, define the analyzer, then reopen the index.
# type: request
value: "{

\ \"analysis\" : {

\ \"analyzer\":{

\ \"content\":{

\ \"type\":\"custom\",

\ \"tokenizer\":\"whitespace\"

\ }

\ }

\ }

value: |-
PUT /my-index-000001/_settings
{
"analysis": {
"analyzer": {
"content": {
"type": "custom",
"tokenizer": "whitespace"
}
}
}
}


POST /my-index-000001/_open"
POST /my-index-000001/_open
alternatives:
- language: Python
code: |-
resp = client.indices.close(
index="my-index-000001",
)

resp1 = client.indices.open(
resp1 = client.indices.put_settings(
index="my-index-000001",
settings={
"analysis": {
"analyzer": {
"content": {
"type": "custom",
"tokenizer": "whitespace"
}
}
}
},
)

resp2 = client.indices.open(
index="my-index-000001",
)
- language: JavaScript
Expand All @@ -40,12 +45,30 @@ alternatives:
index: "my-index-000001",
});

const response1 = await client.indices.open({
const response1 = await client.indices.putSettings({
index: "my-index-000001",
settings: {
analysis: {
analyzer: {
content: {
type: "custom",
tokenizer: "whitespace",
},
},
},
},
});

const response2 = await client.indices.open({
index: "my-index-000001",
});
- language: Ruby
code: |-
response = client.indices.close(
index: "my-index-000001"
)

response1 = client.indices.put_settings(
index: "my-index-000001",
body: {
"analysis": {
Expand All @@ -59,13 +82,17 @@ alternatives:
}
)

response1 = client.indices.open(
response2 = client.indices.open(
index: "my-index-000001"
)
- language: PHP
code: |-
$resp = $client->indices()->close([
"index" => "my-index-000001",
]);

$resp1 = $client->indices()->putSettings([
"index" => "my-index-000001",
"body" => [
"analysis" => [
"analyzer" => [
Expand All @@ -78,12 +105,15 @@ alternatives:
],
]);

$resp1 = $client->indices()->open([
$resp2 = $client->indices()->open([
"index" => "my-index-000001",
]);
- language: curl
code: >-
curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d
'{"analysis":{"analyzer":{"content":{"type":"custom","tokenizer":"whitespace"}}}}' "$ELASTICSEARCH_URL/my-index-000001/_close"
curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_close"

curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d
'{"analysis":{"analyzer":{"content":{"type":"custom","tokenizer":"whitespace"}}}}'
"$ELASTICSEARCH_URL/my-index-000001/_settings"

curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_open"
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ alternatives:
''{"docs":[{"text":"The fool doth think he is wise, but the wise man knows himself to be a fool."}]}''
"$ELASTICSEARCH_URL/_ml/trained_models/lang_ident_model_1/_infer"'
- language: Java
code: |
code: >
client.ml().inferTrainedModel(i -> i
.docs(Map.of("text", JsonData.fromJson("\"The fool doth think he is wise, but the wise man knows himself to be a fool.\"")))
.modelId("lang_ident_model_1")
Expand Down
Loading