diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 1bbcaf48f0..f9f3bd3ff3 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -125434,8 +125434,8 @@ }, "indicesPutSettingsRequestExample3": { "summary": "Update index analysis", - "description": "To add an analyzer, you must close the index, define the analyzer, then reopen the index.", - "value": "{\n \"analysis\" : {\n \"analyzer\":{\n \"content\":{\n \"type\":\"custom\",\n \"tokenizer\":\"whitespace\"\n }\n }\n }\n}\n\nPOST /my-index-000001/_open" + "description": "To add an analyzer, you must close the index (`POST /my-index-000001/_open`), define the analyzer, then reopen the index (`POST /my-index-000001/_open`).", + "value": "{\n \"analysis\": {\n \"analyzer\": {\n \"content\": {\n \"type\": \"custom\",\n \"tokenizer\": \"whitespace\"\n }\n }\n }\n}" } } } diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index df8f54a6c6..279923a7b5 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -75194,8 +75194,8 @@ }, "indicesPutSettingsRequestExample3": { "summary": "Update index analysis", - "description": "To add an analyzer, you must close the index, define the analyzer, then reopen the index.", - "value": "{\n \"analysis\" : {\n \"analyzer\":{\n \"content\":{\n \"type\":\"custom\",\n \"tokenizer\":\"whitespace\"\n }\n }\n }\n}\n\nPOST /my-index-000001/_open" + "description": "To add an analyzer, you must close the index (`POST /my-index-000001/_open`), define the analyzer, then reopen the index (`POST /my-index-000001/_open`).", + "value": "{\n \"analysis\": {\n \"analyzer\": {\n \"content\": {\n \"type\": \"custom\",\n \"tokenizer\": \"whitespace\"\n }\n }\n }\n}" } } } diff --git a/output/schema/schema.json b/output/schema/schema.json index 0b0e2632de..9904592236 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -158593,30 +158593,30 @@ "indicesPutSettingsRequestExample3": { "alternatives": [ { - "code": "resp = client.indices.close(\n index=\"my-index-000001\",\n)\n\nresp1 = client.indices.open(\n index=\"my-index-000001\",\n)", + "code": "resp = client.indices.put_settings(\n index=\"my-index-000001\",\n settings={\n \"analysis\": {\n \"analyzer\": {\n \"content\": {\n \"type\": \"custom\",\n \"tokenizer\": \"whitespace\"\n }\n }\n }\n },\n)", "language": "Python" }, { - "code": "const response = await client.indices.close({\n index: \"my-index-000001\",\n});\n\nconst response1 = await client.indices.open({\n index: \"my-index-000001\",\n});", + "code": "const response = await client.indices.putSettings({\n index: \"my-index-000001\",\n settings: {\n analysis: {\n analyzer: {\n content: {\n type: \"custom\",\n tokenizer: \"whitespace\",\n },\n },\n },\n },\n});", "language": "JavaScript" }, { - "code": "response = client.indices.close(\n index: \"my-index-000001\",\n body: {\n \"analysis\": {\n \"analyzer\": {\n \"content\": {\n \"type\": \"custom\",\n \"tokenizer\": \"whitespace\"\n }\n }\n }\n }\n)\n\nresponse1 = client.indices.open(\n index: \"my-index-000001\"\n)", + "code": "response = client.indices.put_settings(\n index: \"my-index-000001\",\n body: {\n \"analysis\": {\n \"analyzer\": {\n \"content\": {\n \"type\": \"custom\",\n \"tokenizer\": \"whitespace\"\n }\n }\n }\n }\n)", "language": "Ruby" }, { - "code": "$resp = $client->indices()->close([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"analysis\" => [\n \"analyzer\" => [\n \"content\" => [\n \"type\" => \"custom\",\n \"tokenizer\" => \"whitespace\",\n ],\n ],\n ],\n ],\n]);\n\n$resp1 = $client->indices()->open([\n \"index\" => \"my-index-000001\",\n]);", + "code": "$resp = $client->indices()->putSettings([\n \"index\" => \"my-index-000001\",\n \"body\" => [\n \"analysis\" => [\n \"analyzer\" => [\n \"content\" => [\n \"type\" => \"custom\",\n \"tokenizer\" => \"whitespace\",\n ],\n ],\n ],\n ],\n]);", "language": "PHP" }, { - "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\"\ncurl -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\"", "language": "curl" } ], - "description": "To add an analyzer, you must close the index, define the analyzer, then reopen the index.", - "method_request": "POST /my-index-000001/_close", + "description": "To add an analyzer, you must close the index (`POST /my-index-000001/_open`), define the analyzer, then reopen the index (`POST /my-index-000001/_open`).", + "method_request": "PUT /my-index-000001/_settings", "summary": "Update index analysis", - "value": "{\n \"analysis\" : {\n \"analyzer\":{\n \"content\":{\n \"type\":\"custom\",\n \"tokenizer\":\"whitespace\"\n }\n }\n }\n}\n\nPOST /my-index-000001/_open" + "value": "{\n \"analysis\": {\n \"analyzer\": {\n \"content\": {\n \"type\": \"custom\",\n \"tokenizer\": \"whitespace\"\n }\n }\n }\n}" } }, "inherits": { diff --git a/specification/eql/search/examples/request/EqlSearchRequestExample2.yaml b/specification/eql/search/examples/request/EqlSearchRequestExample2.yaml index 15b73338c5..ecc5f9052c 100644 --- a/specification/eql/search/examples/request/EqlSearchRequestExample2.yaml +++ b/specification/eql/search/examples/request/EqlSearchRequestExample2.yaml @@ -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\") ] ") diff --git a/specification/esql/query/examples/request/QueryRequestExample1.yaml b/specification/esql/query/examples/request/QueryRequestExample1.yaml index 158720686b..681a7b933b 100644 --- a/specification/esql/query/examples/request/QueryRequestExample1.yaml +++ b/specification/esql/query/examples/request/QueryRequestExample1.yaml @@ -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 ") diff --git a/specification/indices/put_settings/examples/request/indicesPutSettingsRequestExample3.yaml b/specification/indices/put_settings/examples/request/indicesPutSettingsRequestExample3.yaml index a4b1c52b5e..d4b59359ca 100644 --- a/specification/indices/put_settings/examples/request/indicesPutSettingsRequestExample3.yaml +++ b/specification/indices/put_settings/examples/request/indicesPutSettingsRequestExample3.yaml @@ -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": { @@ -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" => [ @@ -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"' diff --git a/specification/ml/infer_trained_model/examples/request/MlInferTrainedModelExample1.yaml b/specification/ml/infer_trained_model/examples/request/MlInferTrainedModelExample1.yaml index b10a3fe433..2d671a7d2f 100644 --- a/specification/ml/infer_trained_model/examples/request/MlInferTrainedModelExample1.yaml +++ b/specification/ml/infer_trained_model/examples/request/MlInferTrainedModelExample1.yaml @@ -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")