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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions output/openapi/elasticsearch-openapi.json

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

4 changes: 2 additions & 2 deletions output/openapi/elasticsearch-serverless-openapi.json

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

16 changes: 8 additions & 8 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
@@ -1,51 +1,54 @@
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.
method_request: PUT /my-index-000001/_settings
description:
To add an analyzer, you must close the index (`POST /my-index-000001/_close`), define the analyzer, then reopen the
index (`POST /my-index-000001/_open`).
# type: request
value: "{

\ \"analysis\" : {

\ \"analyzer\":{

\ \"content\":{

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

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

\ }

\ }

\ }

value: |-
{
"analysis": {
"analyzer": {
"content": {
"type": "custom",
"tokenizer": "whitespace"
}
}
}
}


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

resp1 = client.indices.open(
resp = client.indices.put_settings(
index="my-index-000001",
settings={
"analysis": {
"analyzer": {
"content": {
"type": "custom",
"tokenizer": "whitespace"
}
}
}
},
)
- language: JavaScript
code: |-
const response = await client.indices.close({
index: "my-index-000001",
});

const response1 = await client.indices.open({
const response = await client.indices.putSettings({
index: "my-index-000001",
settings: {
analysis: {
analyzer: {
content: {
type: "custom",
tokenizer: "whitespace",
},
},
},
},
});
- language: Ruby
code: |-
response = client.indices.close(
response = client.indices.put_settings(
index: "my-index-000001",
body: {
"analysis": {
Expand All @@ -58,13 +61,9 @@ alternatives:
}
}
)

response1 = client.indices.open(
index: "my-index-000001"
)
- language: PHP
code: |-
$resp = $client->indices()->close([
$resp = $client->indices()->putSettings([
"index" => "my-index-000001",
"body" => [
"analysis" => [
Expand All @@ -77,13 +76,8 @@ alternatives:
],
],
]);

$resp1 = $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/_open"
code:
'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"'
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