diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index eb721590af..b1f80f6461 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -123939,8 +123939,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 b5fa344714..a418e96eff 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -73927,8 +73927,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 b76cfb3529..23c8cf9b72 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -156001,30 +156001,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/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"'