From 8b0c2c267f3d1e98d6d206c568202f69b35bfbae Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Mon, 28 Oct 2024 06:04:01 +0000 Subject: [PATCH] Auto-generated API code --- .../0e31b8ad176b31028becf9500989bcbd.asciidoc | 21 ++++++++ ...3ab8f65fcb55a0e3664c55749ec41efd.asciidoc} | 1 + .../40f287bf733420bbab134b74c7d0ea5d.asciidoc | 16 ++++++ .../4b91ad7c9b44e07db4a4e81390f19ad3.asciidoc | 14 +++++ .../5ceb734e3affe00e2cdc29af748d95bf.asciidoc | 23 ++++++++ ...5f16358ebb5d14b86f57612d5f92d923.asciidoc} | 1 - .../76c73b54f3f1e5cb1c0fcccd7c3fd18e.asciidoc | 52 +++++++++++++++++++ ...7a2fdfd7b0553d63440af7598f9ad867.asciidoc} | 2 +- .../7b9691bd34a02dd859562eb927f175e0.asciidoc | 23 ++++++++ .../7db09cab02d71f3a10d91071216d80fc.asciidoc | 18 +++++++ ...8080cd9e24a8785728ce7c372ec4acf1.asciidoc} | 7 +-- .../85f9fc6f98e8573efed9b034e853d5ae.asciidoc | 17 ++++++ ...8a0b5f759de3f27f0801c1176e616117.asciidoc} | 1 - .../96e88611f99e6834bd64b58dc8a282c1.asciidoc | 18 +++++++ ...b3f442a7d9eb391121dcab991787f9d6.asciidoc} | 12 +++-- .../c8aa8e8c0ac160b8c4efd1ac3b9f48f3.asciidoc | 23 ++++++++ ...ccc613951c61f0b17e1ed8a2d3ae54a2.asciidoc} | 8 +++ ...f95a4d7ab02bf400246c8822f0245f02.asciidoc} | 2 +- 18 files changed, 249 insertions(+), 10 deletions(-) create mode 100644 docs/doc_examples/0e31b8ad176b31028becf9500989bcbd.asciidoc rename docs/doc_examples/{d1a285aa244ec461d68f13e7078a33c0.asciidoc => 3ab8f65fcb55a0e3664c55749ec41efd.asciidoc} (96%) create mode 100644 docs/doc_examples/40f287bf733420bbab134b74c7d0ea5d.asciidoc create mode 100644 docs/doc_examples/4b91ad7c9b44e07db4a4e81390f19ad3.asciidoc create mode 100644 docs/doc_examples/5ceb734e3affe00e2cdc29af748d95bf.asciidoc rename docs/doc_examples/{19f1f9f25933f8e7aba59a10881c648b.asciidoc => 5f16358ebb5d14b86f57612d5f92d923.asciidoc} (89%) create mode 100644 docs/doc_examples/76c73b54f3f1e5cb1c0fcccd7c3fd18e.asciidoc rename docs/doc_examples/{58f6b72009512851843c7b7a20e9504a.asciidoc => 7a2fdfd7b0553d63440af7598f9ad867.asciidoc} (94%) create mode 100644 docs/doc_examples/7b9691bd34a02dd859562eb927f175e0.asciidoc create mode 100644 docs/doc_examples/7db09cab02d71f3a10d91071216d80fc.asciidoc rename docs/doc_examples/{1d918e206ad8dab916e59183da24d9ec.asciidoc => 8080cd9e24a8785728ce7c372ec4acf1.asciidoc} (68%) create mode 100644 docs/doc_examples/85f9fc6f98e8573efed9b034e853d5ae.asciidoc rename docs/doc_examples/{c8fa8d7e029792d539464fede18ce258.asciidoc => 8a0b5f759de3f27f0801c1176e616117.asciidoc} (89%) create mode 100644 docs/doc_examples/96e88611f99e6834bd64b58dc8a282c1.asciidoc rename docs/doc_examples/{51390ca10aa22d7104e8970f09ea4512.asciidoc => b3f442a7d9eb391121dcab991787f9d6.asciidoc} (81%) create mode 100644 docs/doc_examples/c8aa8e8c0ac160b8c4efd1ac3b9f48f3.asciidoc rename docs/doc_examples/{2267e2ac10e6f4ecc691b7c6d46d1c14.asciidoc => ccc613951c61f0b17e1ed8a2d3ae54a2.asciidoc} (90%) rename docs/doc_examples/{1af9742c71ce0587cd49a73ec7fc1f6c.asciidoc => f95a4d7ab02bf400246c8822f0245f02.asciidoc} (94%) diff --git a/docs/doc_examples/0e31b8ad176b31028becf9500989bcbd.asciidoc b/docs/doc_examples/0e31b8ad176b31028becf9500989bcbd.asciidoc new file mode 100644 index 000000000..53fcff58d --- /dev/null +++ b/docs/doc_examples/0e31b8ad176b31028becf9500989bcbd.asciidoc @@ -0,0 +1,21 @@ +// 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.put({ + task_type: "text_embedding", + inference_id: "watsonx-embeddings", + inference_config: { + service: "watsonxai", + service_settings: { + api_key: "", + url: "", + model_id: "ibm/slate-30m-english-rtrvr", + project_id: "", + api_version: "2024-03-14", + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/d1a285aa244ec461d68f13e7078a33c0.asciidoc b/docs/doc_examples/3ab8f65fcb55a0e3664c55749ec41efd.asciidoc similarity index 96% rename from docs/doc_examples/d1a285aa244ec461d68f13e7078a33c0.asciidoc rename to docs/doc_examples/3ab8f65fcb55a0e3664c55749ec41efd.asciidoc index e21b336f5..e498feff3 100644 --- a/docs/doc_examples/d1a285aa244ec461d68f13e7078a33c0.asciidoc +++ b/docs/doc_examples/3ab8f65fcb55a0e3664c55749ec41efd.asciidoc @@ -29,6 +29,7 @@ const response = await client.indices.create({ "arabic_normalization", "persian_normalization", "persian_stop", + "persian_stem", ], }, }, diff --git a/docs/doc_examples/40f287bf733420bbab134b74c7d0ea5d.asciidoc b/docs/doc_examples/40f287bf733420bbab134b74c7d0ea5d.asciidoc new file mode 100644 index 000000000..5b94aaeb7 --- /dev/null +++ b/docs/doc_examples/40f287bf733420bbab134b74c7d0ea5d.asciidoc @@ -0,0 +1,16 @@ +// 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: "amazon-reviews", + id: 1, + document: { + review_text: + "This product is lifechanging! I'm telling all my friends about it.", + review_vector: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8], + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/4b91ad7c9b44e07db4a4e81390f19ad3.asciidoc b/docs/doc_examples/4b91ad7c9b44e07db4a4e81390f19ad3.asciidoc new file mode 100644 index 000000000..5f31b1de6 --- /dev/null +++ b/docs/doc_examples/4b91ad7c9b44e07db4a4e81390f19ad3.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.streamInference({ + task_type: "completion", + inference_id: "openai-completion", + body: { + input: "What is Elastic?", + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/5ceb734e3affe00e2cdc29af748d95bf.asciidoc b/docs/doc_examples/5ceb734e3affe00e2cdc29af748d95bf.asciidoc new file mode 100644 index 000000000..e2a1539c1 --- /dev/null +++ b/docs/doc_examples/5ceb734e3affe00e2cdc29af748d95bf.asciidoc @@ -0,0 +1,23 @@ +// 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.put({ + task_type: "sparse_embedding", + inference_id: "small_chunk_size", + inference_config: { + service: "elasticsearch", + service_settings: { + num_allocations: 1, + num_threads: 1, + }, + chunking_settings: { + strategy: "sentence", + max_chunk_size: 100, + sentence_overlap: 0, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/19f1f9f25933f8e7aba59a10881c648b.asciidoc b/docs/doc_examples/5f16358ebb5d14b86f57612d5f92d923.asciidoc similarity index 89% rename from docs/doc_examples/19f1f9f25933f8e7aba59a10881c648b.asciidoc rename to docs/doc_examples/5f16358ebb5d14b86f57612d5f92d923.asciidoc index 1d9708b3c..454dd9502 100644 --- a/docs/doc_examples/19f1f9f25933f8e7aba59a10881c648b.asciidoc +++ b/docs/doc_examples/5f16358ebb5d14b86f57612d5f92d923.asciidoc @@ -9,7 +9,6 @@ const response = await client.indices.create({ properties: { inference_field: { type: "semantic_text", - inference_id: "my-elser-endpoint", }, }, }, diff --git a/docs/doc_examples/76c73b54f3f1e5cb1c0fcccd7c3fd18e.asciidoc b/docs/doc_examples/76c73b54f3f1e5cb1c0fcccd7c3fd18e.asciidoc new file mode 100644 index 000000000..b40a8f8d9 --- /dev/null +++ b/docs/doc_examples/76c73b54f3f1e5cb1c0fcccd7c3fd18e.asciidoc @@ -0,0 +1,52 @@ +// 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.bulk({ + operations: [ + { + index: { + _index: "amazon-reviews", + _id: "2", + }, + }, + { + review_text: "This product is amazing! I love it.", + review_vector: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8], + }, + { + index: { + _index: "amazon-reviews", + _id: "3", + }, + }, + { + review_text: "This product is terrible. I hate it.", + review_vector: [0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1], + }, + { + index: { + _index: "amazon-reviews", + _id: "4", + }, + }, + { + review_text: "This product is great. I can do anything with it.", + review_vector: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8], + }, + { + index: { + _index: "amazon-reviews", + _id: "5", + }, + }, + { + review_text: + "This product has ruined my life and the lives of my family and friends.", + review_vector: [0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1], + }, + ], +}); +console.log(response); +---- diff --git a/docs/doc_examples/58f6b72009512851843c7b7a20e9504a.asciidoc b/docs/doc_examples/7a2fdfd7b0553d63440af7598f9ad867.asciidoc similarity index 94% rename from docs/doc_examples/58f6b72009512851843c7b7a20e9504a.asciidoc rename to docs/doc_examples/7a2fdfd7b0553d63440af7598f9ad867.asciidoc index ab21c2d80..63fb1f69a 100644 --- a/docs/doc_examples/58f6b72009512851843c7b7a20e9504a.asciidoc +++ b/docs/doc_examples/7a2fdfd7b0553d63440af7598f9ad867.asciidoc @@ -4,7 +4,7 @@ [source, js] ---- const response = await client.indices.create({ - index: "my-index-000002", + index: "my-index-000003", mappings: { properties: { inference_field: { diff --git a/docs/doc_examples/7b9691bd34a02dd859562eb927f175e0.asciidoc b/docs/doc_examples/7b9691bd34a02dd859562eb927f175e0.asciidoc new file mode 100644 index 000000000..847cbc4b8 --- /dev/null +++ b/docs/doc_examples/7b9691bd34a02dd859562eb927f175e0.asciidoc @@ -0,0 +1,23 @@ +// 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.put({ + task_type: "sparse_embedding", + inference_id: "my-elser-model", + inference_config: { + service: "elasticsearch", + service_settings: { + adaptive_allocations: { + enabled: true, + min_number_of_allocations: 1, + max_number_of_allocations: 10, + }, + num_threads: 1, + model_id: ".elser_model_2", + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/7db09cab02d71f3a10d91071216d80fc.asciidoc b/docs/doc_examples/7db09cab02d71f3a10d91071216d80fc.asciidoc new file mode 100644 index 000000000..94a971289 --- /dev/null +++ b/docs/doc_examples/7db09cab02d71f3a10d91071216d80fc.asciidoc @@ -0,0 +1,18 @@ +// 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: "amazon-reviews", + retriever: { + knn: { + field: "review_vector", + query_vector: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8], + k: 2, + num_candidates: 5, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/1d918e206ad8dab916e59183da24d9ec.asciidoc b/docs/doc_examples/8080cd9e24a8785728ce7c372ec4acf1.asciidoc similarity index 68% rename from docs/doc_examples/1d918e206ad8dab916e59183da24d9ec.asciidoc rename to docs/doc_examples/8080cd9e24a8785728ce7c372ec4acf1.asciidoc index 6e0a57866..2904d2dc7 100644 --- a/docs/doc_examples/1d918e206ad8dab916e59183da24d9ec.asciidoc +++ b/docs/doc_examples/8080cd9e24a8785728ce7c372ec4acf1.asciidoc @@ -3,9 +3,10 @@ [source, js] ---- -const response = await client.indices.putSettings({ - index: ".watches", - settings: { +const response = await client.transport.request({ + method: "PUT", + path: "/_watcher/settings", + body: { "index.routing.allocation.include.role": "watcher", }, }); diff --git a/docs/doc_examples/85f9fc6f98e8573efed9b034e853d5ae.asciidoc b/docs/doc_examples/85f9fc6f98e8573efed9b034e853d5ae.asciidoc new file mode 100644 index 000000000..9bc60ea81 --- /dev/null +++ b/docs/doc_examples/85f9fc6f98e8573efed9b034e853d5ae.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.inference.put({ + task_type: "sparse_embedding", + inference_id: "use_existing_deployment", + inference_config: { + service: "elasticsearch", + service_settings: { + deployment_id: ".elser_model_2", + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/c8fa8d7e029792d539464fede18ce258.asciidoc b/docs/doc_examples/8a0b5f759de3f27f0801c1176e616117.asciidoc similarity index 89% rename from docs/doc_examples/c8fa8d7e029792d539464fede18ce258.asciidoc rename to docs/doc_examples/8a0b5f759de3f27f0801c1176e616117.asciidoc index 598fd1f7b..5ac85568d 100644 --- a/docs/doc_examples/c8fa8d7e029792d539464fede18ce258.asciidoc +++ b/docs/doc_examples/8a0b5f759de3f27f0801c1176e616117.asciidoc @@ -9,7 +9,6 @@ const response = await client.indices.create({ properties: { content: { type: "semantic_text", - inference_id: "my-elser-endpoint", }, }, }, diff --git a/docs/doc_examples/96e88611f99e6834bd64b58dc8a282c1.asciidoc b/docs/doc_examples/96e88611f99e6834bd64b58dc8a282c1.asciidoc new file mode 100644 index 000000000..d3786611f --- /dev/null +++ b/docs/doc_examples/96e88611f99e6834bd64b58dc8a282c1.asciidoc @@ -0,0 +1,18 @@ +// 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: { + inference_field: { + type: "semantic_text", + inference_id: "my-openai-endpoint", + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/51390ca10aa22d7104e8970f09ea4512.asciidoc b/docs/doc_examples/b3f442a7d9eb391121dcab991787f9d6.asciidoc similarity index 81% rename from docs/doc_examples/51390ca10aa22d7104e8970f09ea4512.asciidoc rename to docs/doc_examples/b3f442a7d9eb391121dcab991787f9d6.asciidoc index a717a783b..15dcc7ae9 100644 --- a/docs/doc_examples/51390ca10aa22d7104e8970f09ea4512.asciidoc +++ b/docs/doc_examples/b3f442a7d9eb391121dcab991787f9d6.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: { binary: { type: "binary", diff --git a/docs/doc_examples/c8aa8e8c0ac160b8c4efd1ac3b9f48f3.asciidoc b/docs/doc_examples/c8aa8e8c0ac160b8c4efd1ac3b9f48f3.asciidoc new file mode 100644 index 000000000..1bd714230 --- /dev/null +++ b/docs/doc_examples/c8aa8e8c0ac160b8c4efd1ac3b9f48f3.asciidoc @@ -0,0 +1,23 @@ +// 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: "amazon-reviews", + mappings: { + properties: { + review_vector: { + type: "dense_vector", + dims: 8, + index: true, + similarity: "cosine", + }, + review_text: { + type: "text", + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/2267e2ac10e6f4ecc691b7c6d46d1c14.asciidoc b/docs/doc_examples/ccc613951c61f0b17e1ed8a2d3ae54a2.asciidoc similarity index 90% rename from docs/doc_examples/2267e2ac10e6f4ecc691b7c6d46d1c14.asciidoc rename to docs/doc_examples/ccc613951c61f0b17e1ed8a2d3ae54a2.asciidoc index 72b2eb9fb..c97a5d54f 100644 --- a/docs/doc_examples/2267e2ac10e6f4ecc691b7c6d46d1c14.asciidoc +++ b/docs/doc_examples/ccc613951c61f0b17e1ed8a2d3ae54a2.asciidoc @@ -58,6 +58,14 @@ const response = await client.simulate.ingest({ composed_of: ["component_template_1", "component_template_2"], }, }, + mapping_addition: { + dynamic: "strict", + properties: { + foo: { + type: "keyword", + }, + }, + }, }, }); console.log(response); diff --git a/docs/doc_examples/1af9742c71ce0587cd49a73ec7fc1f6c.asciidoc b/docs/doc_examples/f95a4d7ab02bf400246c8822f0245f02.asciidoc similarity index 94% rename from docs/doc_examples/1af9742c71ce0587cd49a73ec7fc1f6c.asciidoc rename to docs/doc_examples/f95a4d7ab02bf400246c8822f0245f02.asciidoc index 5294ec4fa..90668404a 100644 --- a/docs/doc_examples/1af9742c71ce0587cd49a73ec7fc1f6c.asciidoc +++ b/docs/doc_examples/f95a4d7ab02bf400246c8822f0245f02.asciidoc @@ -5,7 +5,7 @@ ---- const response = await client.cat.mlTrainedModels({ h: "c,o,l,ct,v", - v: "ture", + v: "true", }); console.log(response); ----