diff --git a/docs/doc_examples/77113c65e1755313183a8969233a5a07.asciidoc b/docs/doc_examples/01ae196538fac197eedbbf458a4ef31b.asciidoc similarity index 81% rename from docs/doc_examples/77113c65e1755313183a8969233a5a07.asciidoc rename to docs/doc_examples/01ae196538fac197eedbbf458a4ef31b.asciidoc index b9dea4e56..487139330 100644 --- a/docs/doc_examples/77113c65e1755313183a8969233a5a07.asciidoc +++ b/docs/doc_examples/01ae196538fac197eedbbf458a4ef31b.asciidoc @@ -5,10 +5,16 @@ ---- const response = await client.indices.create({ index: "idx", - mappings: { - _source: { - mode: "synthetic", + settings: { + index: { + mapping: { + source: { + mode: "synthetic", + }, + }, }, + }, + mappings: { properties: { kwd: { type: "keyword", diff --git a/docs/doc_examples/611c1e05f4ebb48a1a8c8488238ce34d.asciidoc b/docs/doc_examples/0709a38613d2de90d418ce12b36af30e.asciidoc similarity index 70% rename from docs/doc_examples/611c1e05f4ebb48a1a8c8488238ce34d.asciidoc rename to docs/doc_examples/0709a38613d2de90d418ce12b36af30e.asciidoc index 8303a5630..dfe9d6be5 100644 --- a/docs/doc_examples/611c1e05f4ebb48a1a8c8488238ce34d.asciidoc +++ b/docs/doc_examples/0709a38613d2de90d418ce12b36af30e.asciidoc @@ -3,8 +3,6 @@ [source, js] ---- -const response = await client.cluster.reroute({ - metric: "none", -}); +const response = await client.cluster.reroute(); console.log(response); ---- diff --git a/docs/doc_examples/eed968e0d9fa2a4545c36a4e5f47b64b.asciidoc b/docs/doc_examples/0bee07a581c5776e068f6f4efad5a399.asciidoc similarity index 93% rename from docs/doc_examples/eed968e0d9fa2a4545c36a4e5f47b64b.asciidoc rename to docs/doc_examples/0bee07a581c5776e068f6f4efad5a399.asciidoc index 68ca702c1..5b0c7d4e7 100644 --- a/docs/doc_examples/eed968e0d9fa2a4545c36a4e5f47b64b.asciidoc +++ b/docs/doc_examples/0bee07a581c5776e068f6f4efad5a399.asciidoc @@ -8,6 +8,7 @@ const response = await client.esql.asyncQuery({ body: { query: "\n FROM my-index-000001,cluster_one:my-index-000001,cluster_two:my-index*\n | STATS COUNT(http.response.status_code) BY user.id\n | LIMIT 2\n ", + include_ccs_metadata: true, }, }); console.log(response); diff --git a/docs/doc_examples/ce13afc0c976c5e1f424b58e0c97fd64.asciidoc b/docs/doc_examples/0d30077cd34e93377a3a86f2ebd69415.asciidoc similarity index 94% rename from docs/doc_examples/ce13afc0c976c5e1f424b58e0c97fd64.asciidoc rename to docs/doc_examples/0d30077cd34e93377a3a86f2ebd69415.asciidoc index e06ff8a73..fb9189c62 100644 --- a/docs/doc_examples/ce13afc0c976c5e1f424b58e0c97fd64.asciidoc +++ b/docs/doc_examples/0d30077cd34e93377a3a86f2ebd69415.asciidoc @@ -9,7 +9,7 @@ const response = await client.connector.put({ name: "My Connector", description: "My Connector to sync data to Elastic index from Google Drive", service_type: "google_drive", - language: "english", + language: "en", }); console.log(response); ---- diff --git a/docs/doc_examples/1a7483796087053ba55029d0dc2ab356.asciidoc b/docs/doc_examples/1a7483796087053ba55029d0dc2ab356.asciidoc new file mode 100644 index 000000000..a5696747c --- /dev/null +++ b/docs/doc_examples/1a7483796087053ba55029d0dc2ab356.asciidoc @@ -0,0 +1,19 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.index({ + index: "mv", + refresh: "true", + document: { + a: [2, null, 1], + }, +}); +console.log(response); + +const response1 = await client.esql.query({ + query: "FROM mv | LIMIT 1", +}); +console.log(response1); +---- diff --git a/docs/doc_examples/983a867c90e63e070518f2f709f659ee.asciidoc b/docs/doc_examples/21d41e8cbd107fbdf0901f885834dafc.asciidoc similarity index 80% rename from docs/doc_examples/983a867c90e63e070518f2f709f659ee.asciidoc rename to docs/doc_examples/21d41e8cbd107fbdf0901f885834dafc.asciidoc index 117b811b7..01d52961a 100644 --- a/docs/doc_examples/983a867c90e63e070518f2f709f659ee.asciidoc +++ b/docs/doc_examples/21d41e8cbd107fbdf0901f885834dafc.asciidoc @@ -5,10 +5,16 @@ ---- const response = await client.indices.create({ index: "idx", - mappings: { - _source: { - mode: "synthetic", + settings: { + index: { + mapping: { + source: { + mode: "synthetic", + }, + }, }, + }, + mappings: { properties: { card: { type: "wildcard", diff --git a/docs/doc_examples/dbce6cb1eaf9b2cc36b7f9a13afc63ea.asciidoc b/docs/doc_examples/2267e2ac10e6f4ecc691b7c6d46d1c14.asciidoc similarity index 85% rename from docs/doc_examples/dbce6cb1eaf9b2cc36b7f9a13afc63ea.asciidoc rename to docs/doc_examples/2267e2ac10e6f4ecc691b7c6d46d1c14.asciidoc index 00f3a3a14..72b2eb9fb 100644 --- a/docs/doc_examples/dbce6cb1eaf9b2cc36b7f9a13afc63ea.asciidoc +++ b/docs/doc_examples/2267e2ac10e6f4ecc691b7c6d46d1c14.asciidoc @@ -52,6 +52,12 @@ const response = await client.simulate.ingest({ }, }, }, + index_template_substitutions: { + "my-index-template": { + index_patterns: ["my-index-*"], + composed_of: ["component_template_1", "component_template_2"], + }, + }, }, }); console.log(response); diff --git a/docs/doc_examples/2c079d1ae4819a0c206b9e1aa5623523.asciidoc b/docs/doc_examples/2c079d1ae4819a0c206b9e1aa5623523.asciidoc new file mode 100644 index 000000000..9e9cb47ce --- /dev/null +++ b/docs/doc_examples/2c079d1ae4819a0c206b9e1aa5623523.asciidoc @@ -0,0 +1,77 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.create({ + index: "my-index-000001", + mappings: { + properties: { + attributes: { + type: "passthrough", + priority: 10, + properties: { + id: { + type: "keyword", + }, + }, + }, + }, + }, +}); +console.log(response); + +const response1 = await client.index({ + index: "my-index-000001", + id: 1, + document: { + attributes: { + id: "foo", + zone: 10, + }, + }, +}); +console.log(response1); + +const response2 = await client.search({ + index: "my-index-000001", + query: { + bool: { + must: [ + { + match: { + id: "foo", + }, + }, + { + match: { + zone: 10, + }, + }, + ], + }, + }, +}); +console.log(response2); + +const response3 = await client.search({ + index: "my-index-000001", + query: { + bool: { + must: [ + { + match: { + "attributes.id": "foo", + }, + }, + { + match: { + "attributes.zone": 10, + }, + }, + ], + }, + }, +}); +console.log(response3); +---- diff --git a/docs/doc_examples/55085e6a2891040b6ac696561d0787c8.asciidoc b/docs/doc_examples/55085e6a2891040b6ac696561d0787c8.asciidoc new file mode 100644 index 000000000..eebda22c2 --- /dev/null +++ b/docs/doc_examples/55085e6a2891040b6ac696561d0787c8.asciidoc @@ -0,0 +1,32 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.create({ + index: "my-index-000002", + mappings: { + properties: { + attributes: { + type: "passthrough", + priority: 10, + properties: { + id: { + type: "keyword", + }, + }, + }, + "resource.attributes": { + type: "passthrough", + priority: 20, + properties: { + id: { + type: "keyword", + }, + }, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/97f260817b60f3deb7f7034d7dee7e12.asciidoc b/docs/doc_examples/551799fef2f86e393db83a967e4a30d1.asciidoc similarity index 84% rename from docs/doc_examples/97f260817b60f3deb7f7034d7dee7e12.asciidoc rename to docs/doc_examples/551799fef2f86e393db83a967e4a30d1.asciidoc index de62cbe9d..ee97fb114 100644 --- a/docs/doc_examples/97f260817b60f3deb7f7034d7dee7e12.asciidoc +++ b/docs/doc_examples/551799fef2f86e393db83a967e4a30d1.asciidoc @@ -5,10 +5,16 @@ ---- const response = await client.indices.create({ index: "idx", - mappings: { - _source: { - mode: "synthetic", + settings: { + index: { + mapping: { + source: { + mode: "synthetic", + }, + }, }, + }, + mappings: { properties: { agg_metric: { type: "aggregate_metric_double", diff --git a/docs/doc_examples/5db5349162a4fbe74bffb646926a2495.asciidoc b/docs/doc_examples/56da252798b8e7b006738428aa1a7f4c.asciidoc similarity index 81% rename from docs/doc_examples/5db5349162a4fbe74bffb646926a2495.asciidoc rename to docs/doc_examples/56da252798b8e7b006738428aa1a7f4c.asciidoc index 2f634da70..8f272acdb 100644 --- a/docs/doc_examples/5db5349162a4fbe74bffb646926a2495.asciidoc +++ b/docs/doc_examples/56da252798b8e7b006738428aa1a7f4c.asciidoc @@ -5,10 +5,16 @@ ---- const response = await client.indices.create({ index: "idx", - mappings: { - _source: { - mode: "synthetic", + settings: { + index: { + mapping: { + source: { + mode: "synthetic", + }, + }, }, + }, + mappings: { properties: { my_range: { type: "long_range", diff --git a/docs/doc_examples/5a70db31f587b7ffed5e9bc1445430cb.asciidoc b/docs/doc_examples/5a70db31f587b7ffed5e9bc1445430cb.asciidoc new file mode 100644 index 000000000..255b2df23 --- /dev/null +++ b/docs/doc_examples/5a70db31f587b7ffed5e9bc1445430cb.asciidoc @@ -0,0 +1,22 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.create({ + index: "semantic-embeddings", + mappings: { + properties: { + semantic_text: { + type: "semantic_text", + inference_id: "my-elser-endpoint", + }, + content: { + type: "text", + copy_to: "semantic_text", + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/c4654a4ca2f4600606dcc5bf37186c0b.asciidoc b/docs/doc_examples/5bba213a7f543190139d1a69ab2ed076.asciidoc similarity index 92% rename from docs/doc_examples/c4654a4ca2f4600606dcc5bf37186c0b.asciidoc rename to docs/doc_examples/5bba213a7f543190139d1a69ab2ed076.asciidoc index 674854196..c95b379f3 100644 --- a/docs/doc_examples/c4654a4ca2f4600606dcc5bf37186c0b.asciidoc +++ b/docs/doc_examples/5bba213a7f543190139d1a69ab2ed076.asciidoc @@ -8,6 +8,7 @@ const response = await client.esql.asyncQuery({ body: { query: "\n FROM cluster_one:my-index*,cluster_two:logs*\n | STATS COUNT(http.response.status_code) BY user.id\n | LIMIT 2\n ", + include_ccs_metadata: true, }, }); console.log(response); diff --git a/docs/doc_examples/0bef1fdefeb2956d60d52d3f38397cad.asciidoc b/docs/doc_examples/5cf12cc4f98d98dc79bead7e6556679c.asciidoc similarity index 68% rename from docs/doc_examples/0bef1fdefeb2956d60d52d3f38397cad.asciidoc rename to docs/doc_examples/5cf12cc4f98d98dc79bead7e6556679c.asciidoc index 950e6fd01..423a609ea 100644 --- a/docs/doc_examples/0bef1fdefeb2956d60d52d3f38397cad.asciidoc +++ b/docs/doc_examples/5cf12cc4f98d98dc79bead7e6556679c.asciidoc @@ -5,9 +5,13 @@ ---- const response = await client.indices.create({ index: "idx", - mappings: { - _source: { - mode: "synthetic", + settings: { + index: { + mapping: { + source: { + mode: "synthetic", + }, + }, }, }, }); diff --git a/docs/doc_examples/1d827ae674970692643ea81991e5396e.asciidoc b/docs/doc_examples/5daf8ede198be9b118da5bee9896cb00.asciidoc similarity index 85% rename from docs/doc_examples/1d827ae674970692643ea81991e5396e.asciidoc rename to docs/doc_examples/5daf8ede198be9b118da5bee9896cb00.asciidoc index ac92b9868..d554caaf0 100644 --- a/docs/doc_examples/1d827ae674970692643ea81991e5396e.asciidoc +++ b/docs/doc_examples/5daf8ede198be9b118da5bee9896cb00.asciidoc @@ -5,10 +5,16 @@ ---- const response = await client.indices.create({ index: "idx", - mappings: { - _source: { - mode: "synthetic", + settings: { + index: { + mapping: { + source: { + mode: "synthetic", + }, + }, }, + }, + mappings: { properties: { flattened: { type: "flattened", diff --git a/docs/doc_examples/10535507a9735fcf06600444b9067d4c.asciidoc b/docs/doc_examples/6cb1dae368c945ecf7c9ec332a5743a2.asciidoc similarity index 84% rename from docs/doc_examples/10535507a9735fcf06600444b9067d4c.asciidoc rename to docs/doc_examples/6cb1dae368c945ecf7c9ec332a5743a2.asciidoc index c7bc3b58e..fd3ab96e4 100644 --- a/docs/doc_examples/10535507a9735fcf06600444b9067d4c.asciidoc +++ b/docs/doc_examples/6cb1dae368c945ecf7c9ec332a5743a2.asciidoc @@ -5,10 +5,16 @@ ---- const response = await client.indices.create({ index: "idx", - mappings: { - _source: { - mode: "synthetic", + settings: { + index: { + mapping: { + source: { + mode: "synthetic", + }, + }, }, + }, + mappings: { properties: { text: { type: "text", diff --git a/docs/doc_examples/8bf51fd50195b46bacbf872f460ebec2.asciidoc b/docs/doc_examples/71998bb300ac2a58419b0772cdc1c586.asciidoc similarity index 81% rename from docs/doc_examples/8bf51fd50195b46bacbf872f460ebec2.asciidoc rename to docs/doc_examples/71998bb300ac2a58419b0772cdc1c586.asciidoc index 84bfecb7b..2efade53d 100644 --- a/docs/doc_examples/8bf51fd50195b46bacbf872f460ebec2.asciidoc +++ b/docs/doc_examples/71998bb300ac2a58419b0772cdc1c586.asciidoc @@ -5,10 +5,16 @@ ---- const response = await client.indices.create({ index: "idx", - mappings: { - _source: { - mode: "synthetic", + settings: { + index: { + mapping: { + source: { + mode: "synthetic", + }, + }, }, + }, + mappings: { properties: { versions: { type: "version", diff --git a/docs/doc_examples/35b686d9d9e915d0dea7a4251781767d.asciidoc b/docs/doc_examples/750ac969f9a05567f5cdf4f93d6244b6.asciidoc similarity index 95% rename from docs/doc_examples/35b686d9d9e915d0dea7a4251781767d.asciidoc rename to docs/doc_examples/750ac969f9a05567f5cdf4f93d6244b6.asciidoc index 918d625f6..8a82d0135 100644 --- a/docs/doc_examples/35b686d9d9e915d0dea7a4251781767d.asciidoc +++ b/docs/doc_examples/750ac969f9a05567f5cdf4f93d6244b6.asciidoc @@ -4,7 +4,6 @@ [source, js] ---- const response = await client.cluster.reroute({ - metric: "none", commands: [ { allocate_empty_primary: { diff --git a/docs/doc_examples/79ff4e7fa5c004226d05d7e2bfb5dc1e.asciidoc b/docs/doc_examples/79ff4e7fa5c004226d05d7e2bfb5dc1e.asciidoc new file mode 100644 index 000000000..13de04136 --- /dev/null +++ b/docs/doc_examples/79ff4e7fa5c004226d05d7e2bfb5dc1e.asciidoc @@ -0,0 +1,49 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.putIndexTemplate({ + name: "my-metrics", + index_patterns: ["metrics-mymetrics-*"], + priority: 200, + data_stream: {}, + template: { + settings: { + "index.mode": "time_series", + }, + mappings: { + properties: { + attributes: { + type: "passthrough", + priority: 10, + time_series_dimension: true, + properties: { + "host.name": { + type: "keyword", + }, + }, + }, + cpu: { + type: "integer", + time_series_metric: "counter", + }, + }, + }, + }, +}); +console.log(response); + +const response1 = await client.index({ + index: "metrics-mymetrics-test", + document: { + "@timestamp": "2020-01-01T00:00:00.000Z", + attributes: { + "host.name": "foo", + zone: "bar", + }, + cpu: 10, + }, +}); +console.log(response1); +---- diff --git a/docs/doc_examples/f3574cfee3971d98417b8dc574a91be0.asciidoc b/docs/doc_examples/7d3a74fe0ba3fe95d1c3275365ff9315.asciidoc similarity index 85% rename from docs/doc_examples/f3574cfee3971d98417b8dc574a91be0.asciidoc rename to docs/doc_examples/7d3a74fe0ba3fe95d1c3275365ff9315.asciidoc index 0ae64f8ad..b319e1c28 100644 --- a/docs/doc_examples/f3574cfee3971d98417b8dc574a91be0.asciidoc +++ b/docs/doc_examples/7d3a74fe0ba3fe95d1c3275365ff9315.asciidoc @@ -5,10 +5,16 @@ ---- const response = await client.indices.create({ index: "idx", - mappings: { - _source: { - mode: "synthetic", + settings: { + index: { + mapping: { + source: { + mode: "synthetic", + }, + }, }, + }, + mappings: { properties: { flattened: { type: "flattened", diff --git a/docs/doc_examples/84237aa9da49ab4b4c4e2b21d2548df2.asciidoc b/docs/doc_examples/84237aa9da49ab4b4c4e2b21d2548df2.asciidoc index 09a235c98..ae893a16e 100644 --- a/docs/doc_examples/84237aa9da49ab4b4c4e2b21d2548df2.asciidoc +++ b/docs/doc_examples/84237aa9da49ab4b4c4e2b21d2548df2.asciidoc @@ -3,9 +3,8 @@ [source, js] ---- -const response = await client.snapshot.create({ - repository: "my_repository", - snapshot: "_verify_integrity", +const response = await client.snapshot.repositoryVerifyIntegrity({ + name: "my_repository", }); console.log(response); ---- diff --git a/docs/doc_examples/13fd7a99c5cf53279409ecc679084f87.asciidoc b/docs/doc_examples/8b8b6aac2111b2d8b93758ac737e6543.asciidoc similarity index 80% rename from docs/doc_examples/13fd7a99c5cf53279409ecc679084f87.asciidoc rename to docs/doc_examples/8b8b6aac2111b2d8b93758ac737e6543.asciidoc index 5ce2b993b..9bee24620 100644 --- a/docs/doc_examples/13fd7a99c5cf53279409ecc679084f87.asciidoc +++ b/docs/doc_examples/8b8b6aac2111b2d8b93758ac737e6543.asciidoc @@ -5,10 +5,16 @@ ---- const response = await client.indices.create({ index: "idx_keep", - mappings: { - _source: { - mode: "synthetic", + settings: { + index: { + mapping: { + source: { + mode: "synthetic", + }, + }, }, + }, + mappings: { properties: { path: { type: "object", diff --git a/docs/doc_examples/9ad0864bcd665b63551e944653d32423.asciidoc b/docs/doc_examples/9ad0864bcd665b63551e944653d32423.asciidoc new file mode 100644 index 000000000..f553c8706 --- /dev/null +++ b/docs/doc_examples/9ad0864bcd665b63551e944653d32423.asciidoc @@ -0,0 +1,35 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + index: "semantic-embeddings", + retriever: { + rrf: { + retrievers: [ + { + standard: { + query: { + match: { + content: "How to avoid muscle soreness while running?", + }, + }, + }, + }, + { + standard: { + query: { + semantic: { + field: "semantic_text", + query: "How to avoid muscle soreness while running?", + }, + }, + }, + }, + ], + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/2cd8439db5054c93c49f1bf50433e1bb.asciidoc b/docs/doc_examples/9aedc45f83e022732789e8d796f5a43c.asciidoc similarity index 96% rename from docs/doc_examples/2cd8439db5054c93c49f1bf50433e1bb.asciidoc rename to docs/doc_examples/9aedc45f83e022732789e8d796f5a43c.asciidoc index fb87919cd..f4f4c1e5d 100644 --- a/docs/doc_examples/2cd8439db5054c93c49f1bf50433e1bb.asciidoc +++ b/docs/doc_examples/9aedc45f83e022732789e8d796f5a43c.asciidoc @@ -4,7 +4,6 @@ [source, js] ---- const response = await client.cluster.reroute({ - metric: "none", commands: [ { move: { diff --git a/docs/doc_examples/5b86d54900e2c4c043a54ca7ae2df0f0.asciidoc b/docs/doc_examples/9c2ce0132e4527077443f007d27b1158.asciidoc similarity index 81% rename from docs/doc_examples/5b86d54900e2c4c043a54ca7ae2df0f0.asciidoc rename to docs/doc_examples/9c2ce0132e4527077443f007d27b1158.asciidoc index 9e0654221..a85d946d2 100644 --- a/docs/doc_examples/5b86d54900e2c4c043a54ca7ae2df0f0.asciidoc +++ b/docs/doc_examples/9c2ce0132e4527077443f007d27b1158.asciidoc @@ -5,10 +5,16 @@ ---- const response = await client.indices.create({ index: "idx", - mappings: { - _source: { - mode: "synthetic", + settings: { + index: { + mapping: { + source: { + mode: "synthetic", + }, + }, }, + }, + mappings: { properties: { flattened: { type: "flattened", diff --git a/docs/doc_examples/f38262ef72f73816ec35fa4c9c85760d.asciidoc b/docs/doc_examples/a1b668795243398f5bc40bcc9bead884.asciidoc similarity index 85% rename from docs/doc_examples/f38262ef72f73816ec35fa4c9c85760d.asciidoc rename to docs/doc_examples/a1b668795243398f5bc40bcc9bead884.asciidoc index ec74a3eb1..31d504f3c 100644 --- a/docs/doc_examples/f38262ef72f73816ec35fa4c9c85760d.asciidoc +++ b/docs/doc_examples/a1b668795243398f5bc40bcc9bead884.asciidoc @@ -5,10 +5,16 @@ ---- const response = await client.indices.create({ index: "idx", - mappings: { - _source: { - mode: "synthetic", + settings: { + index: { + mapping: { + source: { + mode: "synthetic", + }, + }, }, + }, + mappings: { properties: { my_range: { type: "long_range", diff --git a/docs/doc_examples/14a49c13c399840e64c00b487aa820c9.asciidoc b/docs/doc_examples/a5aeb2c8bdf91f6146026ec8edc476b6.asciidoc similarity index 81% rename from docs/doc_examples/14a49c13c399840e64c00b487aa820c9.asciidoc rename to docs/doc_examples/a5aeb2c8bdf91f6146026ec8edc476b6.asciidoc index 0ad43b3d4..43cce7452 100644 --- a/docs/doc_examples/14a49c13c399840e64c00b487aa820c9.asciidoc +++ b/docs/doc_examples/a5aeb2c8bdf91f6146026ec8edc476b6.asciidoc @@ -5,10 +5,16 @@ ---- const response = await client.indices.create({ index: "idx", - mappings: { - _source: { - mode: "synthetic", + settings: { + index: { + mapping: { + source: { + mode: "synthetic", + }, + }, }, + }, + mappings: { properties: { date: { type: "date_nanos", diff --git a/docs/doc_examples/2826510e4aeb1c0d8dc43d317ed7624a.asciidoc b/docs/doc_examples/a7d814caf2a995d2aeadecc3495011be.asciidoc similarity index 80% rename from docs/doc_examples/2826510e4aeb1c0d8dc43d317ed7624a.asciidoc rename to docs/doc_examples/a7d814caf2a995d2aeadecc3495011be.asciidoc index 722ee1661..782a1c3cd 100644 --- a/docs/doc_examples/2826510e4aeb1c0d8dc43d317ed7624a.asciidoc +++ b/docs/doc_examples/a7d814caf2a995d2aeadecc3495011be.asciidoc @@ -5,10 +5,16 @@ ---- const response = await client.indices.create({ index: "idx", - mappings: { - _source: { - mode: "synthetic", + settings: { + index: { + mapping: { + source: { + mode: "synthetic", + }, + }, }, + }, + mappings: { properties: { bool: { type: "boolean", diff --git a/docs/doc_examples/794d9a321b944347d2a8834a07b5eb22.asciidoc b/docs/doc_examples/a8dff54362184b2732b9bd248cf6df8a.asciidoc similarity index 81% rename from docs/doc_examples/794d9a321b944347d2a8834a07b5eb22.asciidoc rename to docs/doc_examples/a8dff54362184b2732b9bd248cf6df8a.asciidoc index b72e43b07..e9c4ba6ea 100644 --- a/docs/doc_examples/794d9a321b944347d2a8834a07b5eb22.asciidoc +++ b/docs/doc_examples/a8dff54362184b2732b9bd248cf6df8a.asciidoc @@ -5,10 +5,16 @@ ---- const response = await client.indices.create({ index: "idx", - mappings: { - _source: { - mode: "synthetic", + settings: { + index: { + mapping: { + source: { + mode: "synthetic", + }, + }, }, + }, + mappings: { properties: { my_range: { type: "integer_range", diff --git a/docs/doc_examples/0e5db64154a722a5cbdb84b588ce2ce8.asciidoc b/docs/doc_examples/aad7d80990a6a3c391ff555ce09ae9dc.asciidoc similarity index 80% rename from docs/doc_examples/0e5db64154a722a5cbdb84b588ce2ce8.asciidoc rename to docs/doc_examples/aad7d80990a6a3c391ff555ce09ae9dc.asciidoc index 05cd6d517..bc29bce3b 100644 --- a/docs/doc_examples/0e5db64154a722a5cbdb84b588ce2ce8.asciidoc +++ b/docs/doc_examples/aad7d80990a6a3c391ff555ce09ae9dc.asciidoc @@ -5,10 +5,16 @@ ---- const response = await client.indices.create({ index: "idx", - mappings: { - _source: { - mode: "synthetic", + settings: { + index: { + mapping: { + source: { + mode: "synthetic", + }, + }, }, + }, + mappings: { properties: { f: { type: "scaled_float", diff --git a/docs/doc_examples/f9cb2547ab04461a12bfd25a35be5f96.asciidoc b/docs/doc_examples/ac5b91aa75696f9880451c9439fd9eec.asciidoc similarity index 84% rename from docs/doc_examples/f9cb2547ab04461a12bfd25a35be5f96.asciidoc rename to docs/doc_examples/ac5b91aa75696f9880451c9439fd9eec.asciidoc index 75d369723..08b6a99c8 100644 --- a/docs/doc_examples/f9cb2547ab04461a12bfd25a35be5f96.asciidoc +++ b/docs/doc_examples/ac5b91aa75696f9880451c9439fd9eec.asciidoc @@ -5,10 +5,16 @@ ---- const response = await client.indices.create({ index: "idx", - mappings: { - _source: { - mode: "synthetic", + settings: { + index: { + mapping: { + source: { + mode: "synthetic", + }, + }, }, + }, + mappings: { properties: { my_range: { type: "date_range", diff --git a/docs/doc_examples/c1bb395546102279296534522061829f.asciidoc b/docs/doc_examples/b3479ee4586c15020549afae58d94d65.asciidoc similarity index 83% rename from docs/doc_examples/c1bb395546102279296534522061829f.asciidoc rename to docs/doc_examples/b3479ee4586c15020549afae58d94d65.asciidoc index 791890046..68cc5ab9c 100644 --- a/docs/doc_examples/c1bb395546102279296534522061829f.asciidoc +++ b/docs/doc_examples/b3479ee4586c15020549afae58d94d65.asciidoc @@ -5,10 +5,16 @@ ---- const response = await client.indices.create({ index: "idx", - mappings: { - _source: { - mode: "synthetic", + settings: { + index: { + mapping: { + source: { + mode: "synthetic", + }, + }, }, + }, + mappings: { properties: { point: { type: "geo_point", diff --git a/docs/doc_examples/36063ff9a318dba7bb0be3a230655dc8.asciidoc b/docs/doc_examples/b3cd07f02059165fd62a2f148be3dc58.asciidoc similarity index 80% rename from docs/doc_examples/36063ff9a318dba7bb0be3a230655dc8.asciidoc rename to docs/doc_examples/b3cd07f02059165fd62a2f148be3dc58.asciidoc index af0f597cc..98b1807e4 100644 --- a/docs/doc_examples/36063ff9a318dba7bb0be3a230655dc8.asciidoc +++ b/docs/doc_examples/b3cd07f02059165fd62a2f148be3dc58.asciidoc @@ -5,10 +5,16 @@ ---- const response = await client.indices.create({ index: "idx", - mappings: { - _source: { - mode: "synthetic", + settings: { + index: { + mapping: { + source: { + mode: "synthetic", + }, + }, }, + }, + mappings: { properties: { long: { type: "long", diff --git a/docs/doc_examples/b9ba66209b7fcc111a7bcef0b3e00052.asciidoc b/docs/doc_examples/b9ba66209b7fcc111a7bcef0b3e00052.asciidoc new file mode 100644 index 000000000..61939766d --- /dev/null +++ b/docs/doc_examples/b9ba66209b7fcc111a7bcef0b3e00052.asciidoc @@ -0,0 +1,17 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.index({ + index: "my-index-000001", + id: 1, + document: { + attributes: { + id: "foo", + }, + id: "bar", + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/fe6a21b4a6b33cd6abc522947d6f3ea2.asciidoc b/docs/doc_examples/ba650046f9063f6c43d76f47e0f94403.asciidoc similarity index 81% rename from docs/doc_examples/fe6a21b4a6b33cd6abc522947d6f3ea2.asciidoc rename to docs/doc_examples/ba650046f9063f6c43d76f47e0f94403.asciidoc index dadf119aa..ec556c8dc 100644 --- a/docs/doc_examples/fe6a21b4a6b33cd6abc522947d6f3ea2.asciidoc +++ b/docs/doc_examples/ba650046f9063f6c43d76f47e0f94403.asciidoc @@ -5,10 +5,16 @@ ---- const response = await client.indices.create({ index: "idx", - mappings: { - _source: { - mode: "synthetic", + settings: { + index: { + mapping: { + source: { + mode: "synthetic", + }, + }, }, + }, + mappings: { properties: { date: { type: "date", diff --git a/docs/doc_examples/63d1c07d22a3ca3b0ec6d950547c011c.asciidoc b/docs/doc_examples/bdaf00d791706d7fde25fd65d3735b94.asciidoc similarity index 80% rename from docs/doc_examples/63d1c07d22a3ca3b0ec6d950547c011c.asciidoc rename to docs/doc_examples/bdaf00d791706d7fde25fd65d3735b94.asciidoc index 6d46c2baa..f8485a4c3 100644 --- a/docs/doc_examples/63d1c07d22a3ca3b0ec6d950547c011c.asciidoc +++ b/docs/doc_examples/bdaf00d791706d7fde25fd65d3735b94.asciidoc @@ -5,10 +5,16 @@ ---- const response = await client.indices.create({ index: "idx", - mappings: { - _source: { - mode: "synthetic", + settings: { + index: { + mapping: { + source: { + mode: "synthetic", + }, + }, }, + }, + mappings: { properties: { kwd: { type: "keyword", diff --git a/docs/doc_examples/befa73a8a419fcf3b7798548b54a20bf.asciidoc b/docs/doc_examples/befa73a8a419fcf3b7798548b54a20bf.asciidoc new file mode 100644 index 000000000..2e7e049df --- /dev/null +++ b/docs/doc_examples/befa73a8a419fcf3b7798548b54a20bf.asciidoc @@ -0,0 +1,37 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + index: "my-index", + size: 10, + knn: { + query_vector: [0.04283529, 0.85670587, -0.51402352, 0], + field: "my_int4_vector", + k: 20, + num_candidates: 50, + }, + rescore: { + window_size: 20, + query: { + rescore_query: { + script_score: { + query: { + match_all: {}, + }, + script: { + source: "(dotProduct(params.queryVector, 'my_int4_vector') + 1.0)", + params: { + queryVector: [0.04283529, 0.85670587, -0.51402352, 0], + }, + }, + }, + }, + query_weight: 0, + rescore_query_weight: 1, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/e566e898902e432bc7ea0568400f0c50.asciidoc b/docs/doc_examples/c793efe7280e9b6e09981c4d4f832348.asciidoc similarity index 83% rename from docs/doc_examples/e566e898902e432bc7ea0568400f0c50.asciidoc rename to docs/doc_examples/c793efe7280e9b6e09981c4d4f832348.asciidoc index 8a135621a..ca162517a 100644 --- a/docs/doc_examples/e566e898902e432bc7ea0568400f0c50.asciidoc +++ b/docs/doc_examples/c793efe7280e9b6e09981c4d4f832348.asciidoc @@ -5,10 +5,16 @@ ---- const response = await client.indices.create({ index: "idx", - mappings: { - _source: { - mode: "synthetic", + settings: { + index: { + mapping: { + source: { + mode: "synthetic", + }, + }, }, + }, + mappings: { properties: { ip: { type: "ip", diff --git a/docs/doc_examples/dcf82f3aacae49c0bb4ccbc673f13e9f.asciidoc b/docs/doc_examples/dcf82f3aacae49c0bb4ccbc673f13e9f.asciidoc new file mode 100644 index 000000000..384d005bd --- /dev/null +++ b/docs/doc_examples/dcf82f3aacae49c0bb4ccbc673f13e9f.asciidoc @@ -0,0 +1,28 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + index: "my-index", + size: 10, + query: { + script_score: { + query: { + knn: { + query_vector: [0.04283529, 0.85670587, -0.51402352, 0], + field: "my_int4_vector", + num_candidates: 20, + }, + }, + script: { + source: "(dotProduct(params.queryVector, 'my_int4_vector') + 1.0)", + params: { + queryVector: [0.04283529, 0.85670587, -0.51402352, 0], + }, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/ddaadd91b7743a1c7e946ce1b593cd1b.asciidoc b/docs/doc_examples/ddaadd91b7743a1c7e946ce1b593cd1b.asciidoc new file mode 100644 index 000000000..bd9c35360 --- /dev/null +++ b/docs/doc_examples/ddaadd91b7743a1c7e946ce1b593cd1b.asciidoc @@ -0,0 +1,14 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.inference.inference({ + task_type: "my-inference-endpoint", + inference_id: "_update", + service_settings: { + api_key: "", + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/f1bf0c03581b79c3324cfa3246a60e4d.asciidoc b/docs/doc_examples/f1bf0c03581b79c3324cfa3246a60e4d.asciidoc new file mode 100644 index 000000000..78223bc2b --- /dev/null +++ b/docs/doc_examples/f1bf0c03581b79c3324cfa3246a60e4d.asciidoc @@ -0,0 +1,22 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.create({ + index: "my-byte-quantized-index", + mappings: { + properties: { + my_vector: { + type: "dense_vector", + dims: 64, + index: true, + index_options: { + type: "bbq_hnsw", + }, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/1e0f203aced9344382081ab095c44dde.asciidoc b/docs/doc_examples/f9bad6fd369764185e1cb09b89ee39cc.asciidoc similarity index 83% rename from docs/doc_examples/1e0f203aced9344382081ab095c44dde.asciidoc rename to docs/doc_examples/f9bad6fd369764185e1cb09b89ee39cc.asciidoc index bd8639ace..2045d9c7d 100644 --- a/docs/doc_examples/1e0f203aced9344382081ab095c44dde.asciidoc +++ b/docs/doc_examples/f9bad6fd369764185e1cb09b89ee39cc.asciidoc @@ -5,10 +5,16 @@ ---- const response = await client.indices.create({ index: "idx", - mappings: { - _source: { - mode: "synthetic", + settings: { + index: { + mapping: { + source: { + mode: "synthetic", + }, + }, }, + }, + mappings: { properties: { text: { type: "text", diff --git a/docs/doc_examples/633c8a9fc57268979d8735c557705809.asciidoc b/docs/doc_examples/fb0152f6c70f647a8b6709969113486d.asciidoc similarity index 81% rename from docs/doc_examples/633c8a9fc57268979d8735c557705809.asciidoc rename to docs/doc_examples/fb0152f6c70f647a8b6709969113486d.asciidoc index 7b7b0f2b8..cd8a962e0 100644 --- a/docs/doc_examples/633c8a9fc57268979d8735c557705809.asciidoc +++ b/docs/doc_examples/fb0152f6c70f647a8b6709969113486d.asciidoc @@ -5,10 +5,16 @@ ---- const response = await client.indices.create({ index: "idx", - mappings: { - _source: { - mode: "synthetic", + settings: { + index: { + mapping: { + source: { + mode: "synthetic", + }, + }, }, + }, + mappings: { properties: { kwd: { type: "keyword", diff --git a/docs/doc_examples/1fcc4a3280be399753dcfd5c489ff682.asciidoc b/docs/doc_examples/fe6429d0d82174aa5acf95e96e237380.asciidoc similarity index 82% rename from docs/doc_examples/1fcc4a3280be399753dcfd5c489ff682.asciidoc rename to docs/doc_examples/fe6429d0d82174aa5acf95e96e237380.asciidoc index 5bc970622..0e51c7393 100644 --- a/docs/doc_examples/1fcc4a3280be399753dcfd5c489ff682.asciidoc +++ b/docs/doc_examples/fe6429d0d82174aa5acf95e96e237380.asciidoc @@ -5,10 +5,16 @@ ---- const response = await client.indices.create({ index: "idx", - mappings: { - _source: { - mode: "synthetic", + settings: { + index: { + mapping: { + source: { + mode: "synthetic", + }, + }, }, + }, + mappings: { properties: { my_range: { type: "ip_range", diff --git a/src/api/types.ts b/src/api/types.ts index e1e5f0b9e..7f4746ed0 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -9328,7 +9328,7 @@ export interface ConnectorFeatureEnabled { export interface ConnectorFilteringAdvancedSnippet { created_at?: DateTime updated_at?: DateTime - value: Record + value: any } export interface ConnectorFilteringConfig { @@ -16216,7 +16216,7 @@ export interface NodesInfoNodeInfoXpackLicenseType { } export interface NodesInfoNodeInfoXpackSecurity { - http: NodesInfoNodeInfoXpackSecuritySsl + http?: NodesInfoNodeInfoXpackSecuritySsl enabled: string transport?: NodesInfoNodeInfoXpackSecuritySsl authc?: NodesInfoNodeInfoXpackSecurityAuthc @@ -18323,7 +18323,8 @@ export interface SnapshotRestoreRequest extends RequestBase { } export interface SnapshotRestoreResponse { - snapshot: SnapshotRestoreSnapshotRestore + accepted?: boolean + snapshot?: SnapshotRestoreSnapshotRestore } export interface SnapshotRestoreSnapshotRestore { diff --git a/src/api/typesWithBodyKey.ts b/src/api/typesWithBodyKey.ts index d83114a16..cf6bd36db 100644 --- a/src/api/typesWithBodyKey.ts +++ b/src/api/typesWithBodyKey.ts @@ -9429,7 +9429,7 @@ export interface ConnectorFeatureEnabled { export interface ConnectorFilteringAdvancedSnippet { created_at?: DateTime updated_at?: DateTime - value: Record + value: any } export interface ConnectorFilteringConfig { @@ -16568,7 +16568,7 @@ export interface NodesInfoNodeInfoXpackLicenseType { } export interface NodesInfoNodeInfoXpackSecurity { - http: NodesInfoNodeInfoXpackSecuritySsl + http?: NodesInfoNodeInfoXpackSecuritySsl enabled: string transport?: NodesInfoNodeInfoXpackSecuritySsl authc?: NodesInfoNodeInfoXpackSecurityAuthc @@ -18790,7 +18790,8 @@ export interface SnapshotRestoreRequest extends RequestBase { } export interface SnapshotRestoreResponse { - snapshot: SnapshotRestoreSnapshotRestore + accepted?: boolean + snapshot?: SnapshotRestoreSnapshotRestore } export interface SnapshotRestoreSnapshotRestore {