diff --git a/docs/doc_examples/015e6e6132b6d6d44bddb06bc3b316ed.asciidoc b/docs/doc_examples/015e6e6132b6d6d44bddb06bc3b316ed.asciidoc new file mode 100644 index 000000000..dc90ae673 --- /dev/null +++ b/docs/doc_examples/015e6e6132b6d6d44bddb06bc3b316ed.asciidoc @@ -0,0 +1,46 @@ +// 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: "retrievers_example", + retriever: { + rrf: { + retrievers: [ + { + standard: { + query: { + range: { + year: { + gt: 2023, + }, + }, + }, + }, + }, + { + standard: { + query: { + term: { + topic: "elastic", + }, + }, + }, + }, + ], + rank_window_size: 10, + rank_constant: 1, + }, + }, + _source: false, + aggs: { + topics: { + terms: { + field: "topic", + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/0165d22da5f2fc7678392b31d8eb5566.asciidoc b/docs/doc_examples/0165d22da5f2fc7678392b31d8eb5566.asciidoc new file mode 100644 index 000000000..279e91656 --- /dev/null +++ b/docs/doc_examples/0165d22da5f2fc7678392b31d8eb5566.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.inference.put({ + task_type: "rerank", + inference_id: "my-rerank-model", + inference_config: { + service: "cohere", + service_settings: { + model_id: "rerank-english-v3.0", + api_key: "{{COHERE_API_KEY}}", + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/0bc6155e0c88062a4d8490da49db3aa8.asciidoc b/docs/doc_examples/0bc6155e0c88062a4d8490da49db3aa8.asciidoc new file mode 100644 index 000000000..01200be80 --- /dev/null +++ b/docs/doc_examples/0bc6155e0c88062a4d8490da49db3aa8.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.search({ + index: "retrievers_example_nested", + retriever: { + rrf: { + retrievers: [ + { + standard: { + query: { + nested: { + path: "nested_field", + inner_hits: { + name: "nested_vector", + _source: false, + fields: ["nested_field.paragraph_id"], + }, + query: { + knn: { + field: "nested_field.nested_vector", + query_vector: [1, 0, 0.5], + k: 10, + }, + }, + }, + }, + }, + }, + { + standard: { + query: { + term: { + topic: "ai", + }, + }, + }, + }, + ], + rank_window_size: 10, + rank_constant: 1, + }, + }, + _source: ["topic"], +}); +console.log(response); +---- diff --git a/docs/doc_examples/0bee07a581c5776e068f6f4efad5a399.asciidoc b/docs/doc_examples/0bee07a581c5776e068f6f4efad5a399.asciidoc index 5b0c7d4e7..506e4ff5b 100644 --- a/docs/doc_examples/0bee07a581c5776e068f6f4efad5a399.asciidoc +++ b/docs/doc_examples/0bee07a581c5776e068f6f4efad5a399.asciidoc @@ -3,8 +3,12 @@ [source, js] ---- -const response = await client.esql.asyncQuery({ - format: "json", +const response = await client.transport.request({ + method: "POST", + path: "/_query/async", + querystring: { + format: "json", + }, 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 ", diff --git a/docs/doc_examples/0d689ac6e78be5d438f9b5d441be2b44.asciidoc b/docs/doc_examples/0d689ac6e78be5d438f9b5d441be2b44.asciidoc new file mode 100644 index 000000000..c95b502ca --- /dev/null +++ b/docs/doc_examples/0d689ac6e78be5d438f9b5d441be2b44.asciidoc @@ -0,0 +1,57 @@ +// 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: "retrievers_example", + retriever: { + rrf: { + retrievers: [ + { + standard: { + query: { + term: { + topic: "elastic", + }, + }, + }, + }, + { + rrf: { + retrievers: [ + { + standard: { + query: { + query_string: { + query: + "(information retrieval) OR (artificial intelligence)", + default_field: "text", + }, + }, + }, + }, + { + knn: { + field: "vector", + query_vector: [0.23, 0.67, 0.89], + k: 3, + num_candidates: 5, + }, + }, + ], + rank_window_size: 10, + rank_constant: 1, + }, + }, + ], + rank_window_size: 10, + rank_constant: 1, + }, + }, + _source: false, + size: 1, + explain: true, +}); +console.log(response); +---- diff --git a/docs/doc_examples/0dfde6a9d953822fd4b3aa0121ddd8fb.asciidoc b/docs/doc_examples/0dfde6a9d953822fd4b3aa0121ddd8fb.asciidoc index 3801b625f..045036fa2 100644 --- a/docs/doc_examples/0dfde6a9d953822fd4b3aa0121ddd8fb.asciidoc +++ b/docs/doc_examples/0dfde6a9d953822fd4b3aa0121ddd8fb.asciidoc @@ -3,8 +3,9 @@ [source, js] ---- -const response = await client.searchApplication.renderQuery({ - name: "my-app", +const response = await client.transport.request({ + method: "POST", + path: "/_application/search_application/my-app/_render_query", body: { params: { query_string: "my first query", diff --git a/docs/doc_examples/16634cfa7916cf4e8048a1d70e6240f2.asciidoc b/docs/doc_examples/16634cfa7916cf4e8048a1d70e6240f2.asciidoc index 64aa8e2d1..8771d32f7 100644 --- a/docs/doc_examples/16634cfa7916cf4e8048a1d70e6240f2.asciidoc +++ b/docs/doc_examples/16634cfa7916cf4e8048a1d70e6240f2.asciidoc @@ -11,7 +11,7 @@ const response = await client.searchApplication.put({ script: { lang: "mustache", source: - '\n {\n "query": {\n "bool": {\n "must": [\n {{#query}}\n \n {{/query}}\n ],\n "filter": {{#toJson}}_es_filters{{/toJson}}\n }\n },\n "_source": {\n "includes": ["title", "plot"]\n },\n "highlight": {\n "fields": {\n "title": { "fragment_size": 0 },\n "plot": { "fragment_size": 200 }\n }\n },\n "aggs": {{#toJson}}_es_aggs{{/toJson}},\n "from": {{from}},\n "size": {{size}},\n "sort": {{#toJson}}_es_sort_fields{{/toJson}}\n }\n ', + '\n {\n "query": {\n "bool": {\n "must": [\n {{#query}}\n {{/query}}\n ],\n "filter": {{#toJson}}_es_filters{{/toJson}}\n }\n },\n "_source": {\n "includes": ["title", "plot"]\n },\n "highlight": {\n "fields": {\n "title": { "fragment_size": 0 },\n "plot": { "fragment_size": 200 }\n }\n },\n "aggs": {{#toJson}}_es_aggs{{/toJson}},\n "from": {{from}},\n "size": {{size}},\n "sort": {{#toJson}}_es_sort_fields{{/toJson}}\n }\n ', params: { query: "", _es_filters: {}, diff --git a/docs/doc_examples/c02c2916b97b6fa7db82dbc7f0378310.asciidoc b/docs/doc_examples/17b1647c8509543f2388c886f2584a20.asciidoc similarity index 92% rename from docs/doc_examples/c02c2916b97b6fa7db82dbc7f0378310.asciidoc rename to docs/doc_examples/17b1647c8509543f2388c886f2584a20.asciidoc index df440d14e..e1f4fbd3c 100644 --- a/docs/doc_examples/c02c2916b97b6fa7db82dbc7f0378310.asciidoc +++ b/docs/doc_examples/17b1647c8509543f2388c886f2584a20.asciidoc @@ -16,7 +16,7 @@ const response = await client.search({ }, }, field: "text", - inference_id: "my-cohere-rerank-model", + inference_id: "elastic-rerank", inference_text: "How often does the moon hide the sun?", rank_window_size: 100, min_score: 0.5, diff --git a/docs/doc_examples/19c00c6b29bc7dbc5e92b3668da2da93.asciidoc b/docs/doc_examples/19c00c6b29bc7dbc5e92b3668da2da93.asciidoc index c5453ffaf..724b30762 100644 --- a/docs/doc_examples/19c00c6b29bc7dbc5e92b3668da2da93.asciidoc +++ b/docs/doc_examples/19c00c6b29bc7dbc5e92b3668da2da93.asciidoc @@ -3,7 +3,9 @@ [source, js] ---- -const response = await client.simulate.ingest({ +const response = await client.transport.request({ + method: "POST", + path: "/_ingest/_simulate", body: { docs: [ { diff --git a/docs/doc_examples/4dab4c5168047ba596af1beb0e55b845.asciidoc b/docs/doc_examples/22b176a184517cf1b5801f5eb4f17f97.asciidoc similarity index 69% rename from docs/doc_examples/4dab4c5168047ba596af1beb0e55b845.asciidoc rename to docs/doc_examples/22b176a184517cf1b5801f5eb4f17f97.asciidoc index 0ba906074..a0c450d19 100644 --- a/docs/doc_examples/4dab4c5168047ba596af1beb0e55b845.asciidoc +++ b/docs/doc_examples/22b176a184517cf1b5801f5eb4f17f97.asciidoc @@ -3,8 +3,8 @@ [source, js] ---- -const response = await client.cluster.getSettings({ - flat_settings: "true", +const response = await client.indices.rollover({ + alias: "datastream", }); console.log(response); ---- diff --git a/docs/doc_examples/2577acb462b95bd4394523cf2f8a661f.asciidoc b/docs/doc_examples/2577acb462b95bd4394523cf2f8a661f.asciidoc deleted file mode 100644 index 9c0aff110..000000000 --- a/docs/doc_examples/2577acb462b95bd4394523cf2f8a661f.asciidoc +++ /dev/null @@ -1,28 +0,0 @@ -// 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.esql.query({ - format: "txt", - query: - "\n FROM library\n | SORT page_count DESC\n | KEEP name, author\n | LOOKUP era ON author\n | LIMIT 5\n ", - tables: { - era: { - author: { - keyword: [ - "Frank Herbert", - "Peter F. Hamilton", - "Vernor Vinge", - "Alastair Reynolds", - "James S.A. Corey", - ], - }, - era: { - keyword: ["The New Wave", "Diamond", "Diamond", "Diamond", "Hadron"], - }, - }, - }, -}); -console.log(response); ----- diff --git a/docs/doc_examples/2a1eece9a59ac1773edcf0a932c26de0.asciidoc b/docs/doc_examples/2a1eece9a59ac1773edcf0a932c26de0.asciidoc index 4853ab9a3..b3545c105 100644 --- a/docs/doc_examples/2a1eece9a59ac1773edcf0a932c26de0.asciidoc +++ b/docs/doc_examples/2a1eece9a59ac1773edcf0a932c26de0.asciidoc @@ -3,7 +3,9 @@ [source, js] ---- -const response = await client.security.oidcLogout({ +const response = await client.transport.request({ + method: "POST", + path: "/_security/oidc/logout", body: { token: "dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==", diff --git a/docs/doc_examples/2afdf0d83724953aa2875b5fb37d60cc.asciidoc b/docs/doc_examples/2afdf0d83724953aa2875b5fb37d60cc.asciidoc index 44648b27c..e05299751 100644 --- a/docs/doc_examples/2afdf0d83724953aa2875b5fb37d60cc.asciidoc +++ b/docs/doc_examples/2afdf0d83724953aa2875b5fb37d60cc.asciidoc @@ -3,10 +3,12 @@ [source, js] ---- -const response = await client.esql.asyncQueryGet({ - id: "FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=", - wait_for_completion_timeout: "30s", - body: null, +const response = await client.transport.request({ + method: "GET", + path: "/_query/async/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=", + querystring: { + wait_for_completion_timeout: "30s", + }, }); console.log(response); ---- diff --git a/docs/doc_examples/2bb41b0b4876ce98cd0cd8fb6d337f18.asciidoc b/docs/doc_examples/2bb41b0b4876ce98cd0cd8fb6d337f18.asciidoc deleted file mode 100644 index 5317e039e..000000000 --- a/docs/doc_examples/2bb41b0b4876ce98cd0cd8fb6d337f18.asciidoc +++ /dev/null @@ -1,16 +0,0 @@ -// 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.cluster.putSettings({ - persistent: { - "cluster.indices.close.enable": false, - "indices.recovery.max_bytes_per_sec": "50mb", - }, - transient: { - "*": null, - }, -}); -console.log(response); ----- diff --git a/docs/doc_examples/30d051f534aeb884176eedb2c11dac85.asciidoc b/docs/doc_examples/30d051f534aeb884176eedb2c11dac85.asciidoc new file mode 100644 index 000000000..0ea31b07a --- /dev/null +++ b/docs/doc_examples/30d051f534aeb884176eedb2c11dac85.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: "rerank", + inference_id: "my-elastic-rerank", + inference_config: { + service: "elasticsearch", + service_settings: { + model_id: ".rerank-v1", + num_threads: 1, + adaptive_allocations: { + enabled: true, + min_number_of_allocations: 1, + max_number_of_allocations: 4, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/3f1fe5f5f99b98d0891f38003e10b636.asciidoc b/docs/doc_examples/3f1fe5f5f99b98d0891f38003e10b636.asciidoc index b8e2ede87..221e42b58 100644 --- a/docs/doc_examples/3f1fe5f5f99b98d0891f38003e10b636.asciidoc +++ b/docs/doc_examples/3f1fe5f5f99b98d0891f38003e10b636.asciidoc @@ -3,7 +3,9 @@ [source, js] ---- -const response = await client.esql.asyncQuery({ +const response = await client.transport.request({ + method: "POST", + path: "/_query/async", body: { query: "\n FROM library\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\n | STATS MAX(page_count) BY year\n | SORT year\n | LIMIT 5\n ", diff --git a/docs/doc_examples/405511f7c1f12cc0a227b4563fe7b2e2.asciidoc b/docs/doc_examples/405511f7c1f12cc0a227b4563fe7b2e2.asciidoc index ab0617ea6..40d330c9d 100644 --- a/docs/doc_examples/405511f7c1f12cc0a227b4563fe7b2e2.asciidoc +++ b/docs/doc_examples/405511f7c1f12cc0a227b4563fe7b2e2.asciidoc @@ -3,9 +3,9 @@ [source, js] ---- -const response = await client.esql.asyncQueryGet({ - id: "FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=", - body: null, +const response = await client.transport.request({ + method: "GET", + path: "/_query/async/FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=", }); console.log(response); ---- diff --git a/docs/doc_examples/4b91ad7c9b44e07db4a4e81390f19ad3.asciidoc b/docs/doc_examples/4b91ad7c9b44e07db4a4e81390f19ad3.asciidoc index 5f31b1de6..823515f74 100644 --- a/docs/doc_examples/4b91ad7c9b44e07db4a4e81390f19ad3.asciidoc +++ b/docs/doc_examples/4b91ad7c9b44e07db4a4e81390f19ad3.asciidoc @@ -3,9 +3,9 @@ [source, js] ---- -const response = await client.inference.streamInference({ - task_type: "completion", - inference_id: "openai-completion", +const response = await client.transport.request({ + method: "POST", + path: "/_inference/completion/openai-completion/_stream", body: { input: "What is Elastic?", }, diff --git a/docs/doc_examples/191074b2eebd5f74e628c2ada4b6d2e4.asciidoc b/docs/doc_examples/4edfb5934d14ad7655bd7e19a112b5c0.asciidoc similarity index 95% rename from docs/doc_examples/191074b2eebd5f74e628c2ada4b6d2e4.asciidoc rename to docs/doc_examples/4edfb5934d14ad7655bd7e19a112b5c0.asciidoc index 9b24f99c0..3bce99ecc 100644 --- a/docs/doc_examples/191074b2eebd5f74e628c2ada4b6d2e4.asciidoc +++ b/docs/doc_examples/4edfb5934d14ad7655bd7e19a112b5c0.asciidoc @@ -8,11 +8,6 @@ const response = await client.search({ query: { bool: { must: [ - { - term: { - "category.keyword": "Main Course", - }, - }, { term: { tags: "vegetarian", @@ -27,6 +22,11 @@ const response = await client.search({ }, ], should: [ + { + term: { + category: "Main Course", + }, + }, { multi_match: { query: "curry spicy", diff --git a/docs/doc_examples/57dc15e5ad663c342fd5c1d86fcd1b29.asciidoc b/docs/doc_examples/57dc15e5ad663c342fd5c1d86fcd1b29.asciidoc index dcf9e4b2e..2598c7bce 100644 --- a/docs/doc_examples/57dc15e5ad663c342fd5c1d86fcd1b29.asciidoc +++ b/docs/doc_examples/57dc15e5ad663c342fd5c1d86fcd1b29.asciidoc @@ -3,7 +3,9 @@ [source, js] ---- -const response = await client.security.oidcPrepareAuthentication({ +const response = await client.transport.request({ + method: "POST", + path: "/_security/oidc/prepare", body: { realm: "oidc1", state: "lGYK0EcSLjqH6pkT5EVZjC6eIW5YCGgywj2sxROO", diff --git a/docs/doc_examples/5bba213a7f543190139d1a69ab2ed076.asciidoc b/docs/doc_examples/5bba213a7f543190139d1a69ab2ed076.asciidoc index c95b379f3..46cd0a13e 100644 --- a/docs/doc_examples/5bba213a7f543190139d1a69ab2ed076.asciidoc +++ b/docs/doc_examples/5bba213a7f543190139d1a69ab2ed076.asciidoc @@ -3,8 +3,12 @@ [source, js] ---- -const response = await client.esql.asyncQuery({ - format: "json", +const response = await client.transport.request({ + method: "POST", + path: "/_query/async", + querystring: { + format: "json", + }, 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 ", 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/2fd458d37aab509fe2d970c0b6e2a10f.asciidoc b/docs/doc_examples/68d7f7d4d268ee98caead5aef19933d6.asciidoc similarity index 97% rename from docs/doc_examples/2fd458d37aab509fe2d970c0b6e2a10f.asciidoc rename to docs/doc_examples/68d7f7d4d268ee98caead5aef19933d6.asciidoc index 2f15a5eb4..021aa7e19 100644 --- a/docs/doc_examples/2fd458d37aab509fe2d970c0b6e2a10f.asciidoc +++ b/docs/doc_examples/68d7f7d4d268ee98caead5aef19933d6.asciidoc @@ -45,7 +45,7 @@ console.log(response); const response1 = await client.indices.putIndexTemplate({ name: 2, - index_patterns: ["k8s*"], + index_patterns: ["k9s*"], composed_of: ["destination_template"], data_stream: {}, }); diff --git a/docs/doc_examples/6b6fd0a5942dfb9762ad2790cf421a80.asciidoc b/docs/doc_examples/6b6fd0a5942dfb9762ad2790cf421a80.asciidoc index 3dff97a73..30adbe22e 100644 --- a/docs/doc_examples/6b6fd0a5942dfb9762ad2790cf421a80.asciidoc +++ b/docs/doc_examples/6b6fd0a5942dfb9762ad2790cf421a80.asciidoc @@ -11,7 +11,7 @@ const response = await client.searchApplication.put({ script: { lang: "mustache", source: - '\n {\n "query": {\n "bool": {\n "must": [\n {{#query}}\n \n {{/query}}\n ],\n "filter": {{#toJson}}_es_filters{{/toJson}}\n }\n },\n "_source": {\n "includes": ["title", "plot"]\n },\n "aggs": {{#toJson}}_es_aggs{{/toJson}},\n "from": {{from}},\n "size": {{size}},\n "sort": {{#toJson}}_es_sort_fields{{/toJson}}\n }\n ', + '\n {\n "query": {\n "bool": {\n "must": [\n {{#query}}\n {{/query}}\n ],\n "filter": {{#toJson}}_es_filters{{/toJson}}\n }\n },\n "_source": {\n "includes": ["title", "plot"]\n },\n "aggs": {{#toJson}}_es_aggs{{/toJson}},\n "from": {{from}},\n "size": {{size}},\n "sort": {{#toJson}}_es_sort_fields{{/toJson}}\n }\n ', params: { query: "", _es_filters: {}, diff --git a/docs/doc_examples/6f3b723bf6179b96c3413597ed7f49e1.asciidoc b/docs/doc_examples/6f3b723bf6179b96c3413597ed7f49e1.asciidoc index 26bbeb20a..f5995e6b6 100644 --- a/docs/doc_examples/6f3b723bf6179b96c3413597ed7f49e1.asciidoc +++ b/docs/doc_examples/6f3b723bf6179b96c3413597ed7f49e1.asciidoc @@ -3,7 +3,9 @@ [source, js] ---- -const response = await client.security.bulkUpdateApiKeys({ +const response = await client.transport.request({ + method: "POST", + path: "/_security/api_key/_bulk_update", body: { ids: ["VuaCfGcBCdbkQm-e5aOx", "H3_AhoIBA9hmeQJdg7ij"], }, diff --git a/docs/doc_examples/76e02434835630cb830724beb92df354.asciidoc b/docs/doc_examples/76e02434835630cb830724beb92df354.asciidoc new file mode 100644 index 000000000..ab4d1fc80 --- /dev/null +++ b/docs/doc_examples/76e02434835630cb830724beb92df354.asciidoc @@ -0,0 +1,44 @@ +// 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: "retrievers_example", + retriever: { + rrf: { + retrievers: [ + { + knn: { + field: "vector", + query_vector: [0.23, 0.67, 0.89], + k: 3, + num_candidates: 5, + }, + }, + { + text_similarity_reranker: { + retriever: { + standard: { + query: { + term: { + topic: "ai", + }, + }, + }, + }, + field: "text", + inference_id: "my-rerank-model", + inference_text: + "Can I use generative AI to identify user intent and improve search relevance?", + }, + }, + ], + rank_window_size: 10, + rank_constant: 1, + }, + }, + _source: false, +}); +console.log(response); +---- diff --git a/docs/doc_examples/77518e8c6198acfe77c0934fd2fe65cb.asciidoc b/docs/doc_examples/77518e8c6198acfe77c0934fd2fe65cb.asciidoc index 107aebead..ebe4fce86 100644 --- a/docs/doc_examples/77518e8c6198acfe77c0934fd2fe65cb.asciidoc +++ b/docs/doc_examples/77518e8c6198acfe77c0934fd2fe65cb.asciidoc @@ -3,7 +3,9 @@ [source, js] ---- -const response = await client.textStructure.findMessageStructure({ +const response = await client.transport.request({ + method: "POST", + path: "/_text_structure/find_message_structure", body: { messages: [ "[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128", diff --git a/docs/doc_examples/78043831fd32004a82930c8ac8a1d809.asciidoc b/docs/doc_examples/78043831fd32004a82930c8ac8a1d809.asciidoc new file mode 100644 index 000000000..5151bb769 --- /dev/null +++ b/docs/doc_examples/78043831fd32004a82930c8ac8a1d809.asciidoc @@ -0,0 +1,46 @@ +// 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: "retrievers_example", + retriever: { + text_similarity_reranker: { + retriever: { + rrf: { + retrievers: [ + { + standard: { + query: { + query_string: { + query: + "(information retrieval) OR (artificial intelligence)", + default_field: "text", + }, + }, + }, + }, + { + knn: { + field: "vector", + query_vector: [0.23, 0.67, 0.89], + k: 3, + num_candidates: 5, + }, + }, + ], + rank_window_size: 10, + rank_constant: 1, + }, + }, + field: "text", + inference_id: "my-rerank-model", + inference_text: + "What are the state of the art applications of AI in information retrieval?", + }, + }, + _source: false, +}); +console.log(response); +---- diff --git a/docs/doc_examples/79d206a528be704050a437adce2496dd.asciidoc b/docs/doc_examples/79d206a528be704050a437adce2496dd.asciidoc new file mode 100644 index 000000000..60583c320 --- /dev/null +++ b/docs/doc_examples/79d206a528be704050a437adce2496dd.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: "rerank", + inference_id: "my-elastic-rerank", + inference_config: { + service: "elasticsearch", + service_settings: { + model_id: ".rerank-v1", + num_threads: 1, + adaptive_allocations: { + enabled: true, + min_number_of_allocations: 1, + max_number_of_allocations: 10, + }, + }, + }, +}); +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/7ba29f0be2297b54a640b0a17d7ef5ca.asciidoc b/docs/doc_examples/7ba29f0be2297b54a640b0a17d7ef5ca.asciidoc new file mode 100644 index 000000000..d1fcf443c --- /dev/null +++ b/docs/doc_examples/7ba29f0be2297b54a640b0a17d7ef5ca.asciidoc @@ -0,0 +1,11 @@ +// 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.transport.request({ + method: "DELETE", + path: "/_ingest/ip_location/database/my-database-id", +}); +console.log(response); +---- diff --git a/docs/doc_examples/80dd7f5882c59b9c1c90e8351937441f.asciidoc b/docs/doc_examples/80dd7f5882c59b9c1c90e8351937441f.asciidoc index 659fc0e47..28fdff4a5 100644 --- a/docs/doc_examples/80dd7f5882c59b9c1c90e8351937441f.asciidoc +++ b/docs/doc_examples/80dd7f5882c59b9c1c90e8351937441f.asciidoc @@ -3,7 +3,9 @@ [source, js] ---- -const response = await client.security.bulkUpdateApiKeys({ +const response = await client.transport.request({ + method: "POST", + path: "/_security/api_key/_bulk_update", body: { ids: ["VuaCfGcBCdbkQm-e5aOx", "H3_AhoIBA9hmeQJdg7ij"], role_descriptors: { 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/91e106a2affbc8df32cd940684a779ed.asciidoc b/docs/doc_examples/91e106a2affbc8df32cd940684a779ed.asciidoc new file mode 100644 index 000000000..8d9b9da8b --- /dev/null +++ b/docs/doc_examples/91e106a2affbc8df32cd940684a779ed.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.transport.request({ + method: "PUT", + path: "/_ingest/ip_location/database/my-database-1", + body: { + name: "GeoIP2-Domain", + maxmind: { + account_id: "1234567", + }, + }, +}); +console.log(response); +---- 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/97c6c07f46f4177f0565a04bc50924a3.asciidoc b/docs/doc_examples/97c6c07f46f4177f0565a04bc50924a3.asciidoc new file mode 100644 index 000000000..ae96b5501 --- /dev/null +++ b/docs/doc_examples/97c6c07f46f4177f0565a04bc50924a3.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: "retrievers_example", + retriever: { + rrf: { + retrievers: [ + { + standard: { + query: { + query_string: { + query: "(information retrieval) OR (artificial intelligence)", + default_field: "text", + }, + }, + }, + }, + { + knn: { + field: "vector", + query_vector: [0.23, 0.67, 0.89], + k: 3, + num_candidates: 5, + }, + }, + ], + rank_window_size: 10, + rank_constant: 1, + }, + }, + _source: false, +}); +console.log(response); +---- diff --git a/docs/doc_examples/99fb82d49ac477e6a9dfdd71f9465374.asciidoc b/docs/doc_examples/99fb82d49ac477e6a9dfdd71f9465374.asciidoc new file mode 100644 index 000000000..3f2ffdf6b --- /dev/null +++ b/docs/doc_examples/99fb82d49ac477e6a9dfdd71f9465374.asciidoc @@ -0,0 +1,11 @@ +// 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.transport.request({ + method: "DELETE", + path: "/_ingest/ip_location/database/example-database-id", +}); +console.log(response); +---- diff --git a/docs/doc_examples/9afa0844883b7471883aa378a8dd10b4.asciidoc b/docs/doc_examples/9afa0844883b7471883aa378a8dd10b4.asciidoc index 46c6ad610..0cf3aea4d 100644 --- a/docs/doc_examples/9afa0844883b7471883aa378a8dd10b4.asciidoc +++ b/docs/doc_examples/9afa0844883b7471883aa378a8dd10b4.asciidoc @@ -3,9 +3,9 @@ [source, js] ---- -const response = await client.searchApplication.postBehavioralAnalyticsEvent({ - collection_name: "my_analytics_collection", - event_type: "search_click", +const response = await client.transport.request({ + method: "POST", + path: "/_application/analytics/my_analytics_collection/event/search_click", body: { session: { id: "1797ca95-91c9-4e2e-b1bd-9c38e6f386a9", diff --git a/docs/doc_examples/9c01db07c9ac395b6370e3b33965c21f.asciidoc b/docs/doc_examples/9c01db07c9ac395b6370e3b33965c21f.asciidoc index 64e6db48e..8e19908d0 100644 --- a/docs/doc_examples/9c01db07c9ac395b6370e3b33965c21f.asciidoc +++ b/docs/doc_examples/9c01db07c9ac395b6370e3b33965c21f.asciidoc @@ -3,7 +3,9 @@ [source, js] ---- -const response = await client.security.oidcAuthenticate({ +const response = await client.transport.request({ + method: "POST", + path: "/_security/oidc/authenticate", body: { redirect_uri: "https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I", diff --git a/docs/doc_examples/a162eb50853331c80596f5994e9d1c38.asciidoc b/docs/doc_examples/a162eb50853331c80596f5994e9d1c38.asciidoc index 6b9a54625..afaf9d7dc 100644 --- a/docs/doc_examples/a162eb50853331c80596f5994e9d1c38.asciidoc +++ b/docs/doc_examples/a162eb50853331c80596f5994e9d1c38.asciidoc @@ -3,8 +3,9 @@ [source, js] ---- -const response = await client.searchApplication.renderQuery({ - name: "my_search_application", +const response = await client.transport.request({ + method: "POST", + path: "/_application/search_application/my_search_application/_render_query", body: { params: { query_string: "rock climbing", diff --git a/docs/doc_examples/a9f14efc26fdd3c37a71f06c310163d9.asciidoc b/docs/doc_examples/a9f14efc26fdd3c37a71f06c310163d9.asciidoc new file mode 100644 index 000000000..488fb5205 --- /dev/null +++ b/docs/doc_examples/a9f14efc26fdd3c37a71f06c310163d9.asciidoc @@ -0,0 +1,27 @@ +// 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({ + retriever: { + text_similarity_reranker: { + retriever: { + standard: { + query: { + match: { + text: "How often does the moon hide the sun?", + }, + }, + }, + }, + field: "text", + inference_id: "my-elastic-rerank", + inference_text: "How often does the moon hide the sun?", + rank_window_size: 100, + min_score: 0.5, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/ac22cc2b0f4ad659055feed2852a2d59.asciidoc b/docs/doc_examples/ac22cc2b0f4ad659055feed2852a2d59.asciidoc new file mode 100644 index 000000000..0e3921a75 --- /dev/null +++ b/docs/doc_examples/ac22cc2b0f4ad659055feed2852a2d59.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: "retrievers_example", + retriever: { + text_similarity_reranker: { + retriever: { + text_similarity_reranker: { + retriever: { + knn: { + field: "vector", + query_vector: [0.23, 0.67, 0.89], + k: 3, + num_candidates: 5, + }, + }, + rank_window_size: 100, + field: "text", + inference_id: "my-rerank-model", + inference_text: + "What are the state of the art applications of AI in information retrieval?", + }, + }, + rank_window_size: 10, + field: "text", + inference_id: "my-other-more-expensive-rerank-model", + inference_text: + "Applications of Large Language Models in technology and their impact on user satisfaction", + }, + }, + _source: false, +}); +console.log(response); +---- diff --git a/docs/doc_examples/7b9691bd34a02dd859562eb927f175e0.asciidoc b/docs/doc_examples/ad9889fd8a4b5930e312a51f3bc996dc.asciidoc similarity index 93% rename from docs/doc_examples/7b9691bd34a02dd859562eb927f175e0.asciidoc rename to docs/doc_examples/ad9889fd8a4b5930e312a51f3bc996dc.asciidoc index 847cbc4b8..ca15245b8 100644 --- a/docs/doc_examples/7b9691bd34a02dd859562eb927f175e0.asciidoc +++ b/docs/doc_examples/ad9889fd8a4b5930e312a51f3bc996dc.asciidoc @@ -12,7 +12,7 @@ const response = await client.inference.put({ adaptive_allocations: { enabled: true, min_number_of_allocations: 1, - max_number_of_allocations: 10, + max_number_of_allocations: 4, }, num_threads: 1, model_id: ".elser_model_2", diff --git a/docs/doc_examples/b0bddf2ffaa83049b195829c06b875cd.asciidoc b/docs/doc_examples/b0bddf2ffaa83049b195829c06b875cd.asciidoc index 6ce163623..5186df2ae 100644 --- a/docs/doc_examples/b0bddf2ffaa83049b195829c06b875cd.asciidoc +++ b/docs/doc_examples/b0bddf2ffaa83049b195829c06b875cd.asciidoc @@ -3,9 +3,9 @@ [source, js] ---- -const response = await client.searchApplication.renderQuery({ - name: "my_search_application", - body: null, +const response = await client.transport.request({ + method: "POST", + path: "/_application/search_application/my_search_application/_render_query", }); console.log(response); ---- diff --git a/docs/doc_examples/b62eaa20c4e0e48134a6d1d1b3c30b26.asciidoc b/docs/doc_examples/b62eaa20c4e0e48134a6d1d1b3c30b26.asciidoc index 30687161f..57b7fb69d 100644 --- a/docs/doc_examples/b62eaa20c4e0e48134a6d1d1b3c30b26.asciidoc +++ b/docs/doc_examples/b62eaa20c4e0e48134a6d1d1b3c30b26.asciidoc @@ -208,10 +208,13 @@ const response = await client.bulk({ }); console.log(response); -const response1 = await client.textStructure.findFieldStructure({ - index: "test-logs", - field: "message", - body: null, +const response1 = await client.transport.request({ + method: "GET", + path: "/_text_structure/find_field_structure", + querystring: { + index: "test-logs", + field: "message", + }, }); console.log(response1); ---- diff --git a/docs/doc_examples/bb2ba5d1885f87506f90dbb002e518f4.asciidoc b/docs/doc_examples/bb2ba5d1885f87506f90dbb002e518f4.asciidoc new file mode 100644 index 000000000..ac5f2bf5b --- /dev/null +++ b/docs/doc_examples/bb2ba5d1885f87506f90dbb002e518f4.asciidoc @@ -0,0 +1,45 @@ +// 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: "retrievers_example", + retriever: { + rrf: { + retrievers: [ + { + standard: { + query: { + query_string: { + query: "(information retrieval) OR (artificial intelligence)", + default_field: "text", + }, + }, + }, + }, + { + knn: { + field: "vector", + query_vector: [0.23, 0.67, 0.89], + k: 3, + num_candidates: 5, + }, + }, + ], + rank_window_size: 10, + rank_constant: 1, + }, + }, + highlight: { + fields: { + text: { + fragment_size: 150, + number_of_fragments: 3, + }, + }, + }, + _source: false, +}); +console.log(response); +---- diff --git a/docs/doc_examples/bcdfaa4487747249699a86a0dcd22f5e.asciidoc b/docs/doc_examples/bcdfaa4487747249699a86a0dcd22f5e.asciidoc index 06b5f58ec..80d974285 100644 --- a/docs/doc_examples/bcdfaa4487747249699a86a0dcd22f5e.asciidoc +++ b/docs/doc_examples/bcdfaa4487747249699a86a0dcd22f5e.asciidoc @@ -3,7 +3,9 @@ [source, js] ---- -const response = await client.simulate.ingest({ +const response = await client.transport.request({ + method: "POST", + path: "/_ingest/_simulate", body: { docs: [ { diff --git a/docs/doc_examples/bee3fda7bb07086243424b62e5b16ca7.asciidoc b/docs/doc_examples/bee3fda7bb07086243424b62e5b16ca7.asciidoc new file mode 100644 index 000000000..9ab13275d --- /dev/null +++ b/docs/doc_examples/bee3fda7bb07086243424b62e5b16ca7.asciidoc @@ -0,0 +1,83 @@ +// 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: "retrievers_example_nested", + mappings: { + properties: { + nested_field: { + type: "nested", + properties: { + paragraph_id: { + type: "keyword", + }, + nested_vector: { + type: "dense_vector", + dims: 3, + similarity: "l2_norm", + index: true, + }, + }, + }, + topic: { + type: "keyword", + }, + }, + }, +}); +console.log(response); + +const response1 = await client.index({ + index: "retrievers_example_nested", + id: 1, + document: { + nested_field: [ + { + paragraph_id: "1a", + nested_vector: [-1.12, -0.59, 0.78], + }, + { + paragraph_id: "1b", + nested_vector: [-0.12, 1.56, 0.42], + }, + { + paragraph_id: "1c", + nested_vector: [1, -1, 0], + }, + ], + topic: ["ai"], + }, +}); +console.log(response1); + +const response2 = await client.index({ + index: "retrievers_example_nested", + id: 2, + document: { + nested_field: [ + { + paragraph_id: "2a", + nested_vector: [0.23, 1.24, 0.65], + }, + ], + topic: ["information_retrieval"], + }, +}); +console.log(response2); + +const response3 = await client.index({ + index: "retrievers_example_nested", + id: 3, + document: { + topic: ["ai"], + }, +}); +console.log(response3); + +const response4 = await client.indices.refresh({ + index: "retrievers_example_nested", +}); +console.log(response4); +---- diff --git a/docs/doc_examples/c580990a70028bb49cca8a6bde86bbf6.asciidoc b/docs/doc_examples/c580990a70028bb49cca8a6bde86bbf6.asciidoc index 2a14bb328..abc332dd4 100644 --- a/docs/doc_examples/c580990a70028bb49cca8a6bde86bbf6.asciidoc +++ b/docs/doc_examples/c580990a70028bb49cca8a6bde86bbf6.asciidoc @@ -3,7 +3,9 @@ [source, js] ---- -const response = await client.security.bulkUpdateApiKeys({ +const response = await client.transport.request({ + method: "POST", + path: "/_security/api_key/_bulk_update", body: { ids: ["VuaCfGcBCdbkQm-e5aOx", "H3_AhoIBA9hmeQJdg7ij"], role_descriptors: {}, diff --git a/docs/doc_examples/ccc613951c61f0b17e1ed8a2d3ae54a2.asciidoc b/docs/doc_examples/ccc613951c61f0b17e1ed8a2d3ae54a2.asciidoc index c97a5d54f..d44a7b669 100644 --- a/docs/doc_examples/ccc613951c61f0b17e1ed8a2d3ae54a2.asciidoc +++ b/docs/doc_examples/ccc613951c61f0b17e1ed8a2d3ae54a2.asciidoc @@ -3,7 +3,9 @@ [source, js] ---- -const response = await client.simulate.ingest({ +const response = await client.transport.request({ + method: "POST", + path: "/_ingest/_simulate", body: { docs: [ { diff --git a/docs/doc_examples/d35c8cf7a98b3f112e1de8797ec6689d.asciidoc b/docs/doc_examples/d35c8cf7a98b3f112e1de8797ec6689d.asciidoc index 51dea2365..21bcc10b8 100644 --- a/docs/doc_examples/d35c8cf7a98b3f112e1de8797ec6689d.asciidoc +++ b/docs/doc_examples/d35c8cf7a98b3f112e1de8797ec6689d.asciidoc @@ -3,7 +3,9 @@ [source, js] ---- -const response = await client.security.oidcPrepareAuthentication({ +const response = await client.transport.request({ + method: "POST", + path: "/_security/oidc/prepare", body: { iss: "http://127.0.0.1:8080", login_hint: "this_is_an_opaque_string", diff --git a/docs/doc_examples/d4158d486e7fee2702a14068b69e3b33.asciidoc b/docs/doc_examples/d4158d486e7fee2702a14068b69e3b33.asciidoc new file mode 100644 index 000000000..ccee5c776 --- /dev/null +++ b/docs/doc_examples/d4158d486e7fee2702a14068b69e3b33.asciidoc @@ -0,0 +1,154 @@ +// 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: "datastream_template", + index_patterns: ["datastream*"], + data_stream: {}, + template: { + lifecycle: { + downsampling: [ + { + after: "1m", + fixed_interval: "1h", + }, + ], + }, + settings: { + index: { + mode: "time_series", + }, + }, + mappings: { + properties: { + "@timestamp": { + type: "date", + }, + kubernetes: { + properties: { + container: { + properties: { + cpu: { + properties: { + usage: { + properties: { + core: { + properties: { + ns: { + type: "long", + }, + }, + }, + limit: { + properties: { + pct: { + type: "float", + }, + }, + }, + nanocores: { + type: "long", + time_series_metric: "gauge", + }, + node: { + properties: { + pct: { + type: "float", + }, + }, + }, + }, + }, + }, + }, + memory: { + properties: { + available: { + properties: { + bytes: { + type: "long", + time_series_metric: "gauge", + }, + }, + }, + majorpagefaults: { + type: "long", + }, + pagefaults: { + type: "long", + time_series_metric: "gauge", + }, + rss: { + properties: { + bytes: { + type: "long", + time_series_metric: "gauge", + }, + }, + }, + usage: { + properties: { + bytes: { + type: "long", + time_series_metric: "gauge", + }, + limit: { + properties: { + pct: { + type: "float", + }, + }, + }, + node: { + properties: { + pct: { + type: "float", + }, + }, + }, + }, + }, + workingset: { + properties: { + bytes: { + type: "long", + time_series_metric: "gauge", + }, + }, + }, + }, + }, + name: { + type: "keyword", + }, + start_time: { + type: "date", + }, + }, + }, + host: { + type: "keyword", + time_series_dimension: true, + }, + namespace: { + type: "keyword", + time_series_dimension: true, + }, + node: { + type: "keyword", + time_series_dimension: true, + }, + pod: { + type: "keyword", + time_series_dimension: true, + }, + }, + }, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/d4df39f72d3a3b80cd4042f6a21c3f19.asciidoc b/docs/doc_examples/d4df39f72d3a3b80cd4042f6a21c3f19.asciidoc new file mode 100644 index 000000000..592744a30 --- /dev/null +++ b/docs/doc_examples/d4df39f72d3a3b80cd4042f6a21c3f19.asciidoc @@ -0,0 +1,15 @@ +// 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.transport.request({ + method: "PUT", + path: "/_ingest/ip_location/database/my-database-2", + body: { + name: "standard_location", + ipinfo: {}, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/d01a590fa9ea8a0cb34ed8dda502296c.asciidoc b/docs/doc_examples/d8c053ee26c1533ce936ec81101d8e1b.asciidoc similarity index 58% rename from docs/doc_examples/d01a590fa9ea8a0cb34ed8dda502296c.asciidoc rename to docs/doc_examples/d8c053ee26c1533ce936ec81101d8e1b.asciidoc index ec1e35374..e80e90ffd 100644 --- a/docs/doc_examples/d01a590fa9ea8a0cb34ed8dda502296c.asciidoc +++ b/docs/doc_examples/d8c053ee26c1533ce936ec81101d8e1b.asciidoc @@ -3,9 +3,9 @@ [source, js] ---- -const response = await client.cluster.getSettings({ - flat_settings: "true", - filter_path: "transient", +const response = await client.transport.request({ + method: "GET", + path: "/_ingest/ip_location/database/my-database-id", }); console.log(response); ---- diff --git a/docs/doc_examples/dd71b0c9f9197684ff29c61062c55660.asciidoc b/docs/doc_examples/dd71b0c9f9197684ff29c61062c55660.asciidoc index ff630da8a..1fe5e6b4c 100644 --- a/docs/doc_examples/dd71b0c9f9197684ff29c61062c55660.asciidoc +++ b/docs/doc_examples/dd71b0c9f9197684ff29c61062c55660.asciidoc @@ -3,6 +3,9 @@ [source, js] ---- -const response = await client.security.getSettings(); +const response = await client.transport.request({ + method: "GET", + path: "/_security/settings", +}); console.log(response); ---- diff --git a/docs/doc_examples/e3019fd5f23458ae49ad9854c97d321c.asciidoc b/docs/doc_examples/e3019fd5f23458ae49ad9854c97d321c.asciidoc index 5a02c157a..febdc3354 100644 --- a/docs/doc_examples/e3019fd5f23458ae49ad9854c97d321c.asciidoc +++ b/docs/doc_examples/e3019fd5f23458ae49ad9854c97d321c.asciidoc @@ -3,7 +3,9 @@ [source, js] ---- -const response = await client.security.oidcPrepareAuthentication({ +const response = await client.transport.request({ + method: "POST", + path: "/_security/oidc/prepare", body: { realm: "oidc1", }, diff --git a/docs/doc_examples/e4b38973c74037335378d8480f1ce894.asciidoc b/docs/doc_examples/e4b38973c74037335378d8480f1ce894.asciidoc index 92b9b7363..ba52d081d 100644 --- a/docs/doc_examples/e4b38973c74037335378d8480f1ce894.asciidoc +++ b/docs/doc_examples/e4b38973c74037335378d8480f1ce894.asciidoc @@ -3,7 +3,9 @@ [source, js] ---- -const response = await client.simulate.ingest({ +const response = await client.transport.request({ + method: "POST", + path: "/_ingest/_simulate", body: { docs: [ { diff --git a/docs/doc_examples/e6f6d3aeea7ecea47cfd5c3d727f7004.asciidoc b/docs/doc_examples/e6f6d3aeea7ecea47cfd5c3d727f7004.asciidoc new file mode 100644 index 000000000..a0bffb528 --- /dev/null +++ b/docs/doc_examples/e6f6d3aeea7ecea47cfd5c3d727f7004.asciidoc @@ -0,0 +1,44 @@ +// 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: "retrievers_example", + retriever: { + rrf: { + retrievers: [ + { + standard: { + query: { + query_string: { + query: "(information retrieval) OR (artificial intelligence)", + default_field: "text", + }, + }, + }, + }, + { + knn: { + field: "vector", + query_vector: [0.23, 0.67, 0.89], + k: 3, + num_candidates: 5, + }, + }, + ], + rank_window_size: 10, + rank_constant: 1, + }, + }, + collapse: { + field: "year", + inner_hits: { + name: "topic related documents", + _source: ["year"], + }, + }, + _source: false, +}); +console.log(response); +---- diff --git a/docs/doc_examples/ee05714a83d75fb6858e3b9fcbeb8f8b.asciidoc b/docs/doc_examples/ee05714a83d75fb6858e3b9fcbeb8f8b.asciidoc new file mode 100644 index 000000000..abb8e0b60 --- /dev/null +++ b/docs/doc_examples/ee05714a83d75fb6858e3b9fcbeb8f8b.asciidoc @@ -0,0 +1,94 @@ +// 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: "retrievers_example", + mappings: { + properties: { + vector: { + type: "dense_vector", + dims: 3, + similarity: "l2_norm", + index: true, + }, + text: { + type: "text", + }, + year: { + type: "integer", + }, + topic: { + type: "keyword", + }, + }, + }, +}); +console.log(response); + +const response1 = await client.index({ + index: "retrievers_example", + id: 1, + document: { + vector: [0.23, 0.67, 0.89], + text: "Large language models are revolutionizing information retrieval by boosting search precision, deepening contextual understanding, and reshaping user experiences in data-rich environments.", + year: 2024, + topic: ["llm", "ai", "information_retrieval"], + }, +}); +console.log(response1); + +const response2 = await client.index({ + index: "retrievers_example", + id: 2, + document: { + vector: [0.12, 0.56, 0.78], + text: "Artificial intelligence is transforming medicine, from advancing diagnostics and tailoring treatment plans to empowering predictive patient care for improved health outcomes.", + year: 2023, + topic: ["ai", "medicine"], + }, +}); +console.log(response2); + +const response3 = await client.index({ + index: "retrievers_example", + id: 3, + document: { + vector: [0.45, 0.32, 0.91], + text: "AI is redefining security by enabling advanced threat detection, proactive risk analysis, and dynamic defenses against increasingly sophisticated cyber threats.", + year: 2024, + topic: ["ai", "security"], + }, +}); +console.log(response3); + +const response4 = await client.index({ + index: "retrievers_example", + id: 4, + document: { + vector: [0.34, 0.21, 0.98], + text: "Elastic introduces Elastic AI Assistant, the open, generative AI sidekick powered by ESRE to democratize cybersecurity and enable users of every skill level.", + year: 2023, + topic: ["ai", "elastic", "assistant"], + }, +}); +console.log(response4); + +const response5 = await client.index({ + index: "retrievers_example", + id: 5, + document: { + vector: [0.11, 0.65, 0.47], + text: "Learn how to spin up a deployment of our hosted Elasticsearch Service and use Elastic Observability to gain deeper insight into the behavior of your applications and systems.", + year: 2024, + topic: ["documentation", "observability", "elastic"], + }, +}); +console.log(response5); + +const response6 = await client.indices.refresh({ + index: "retrievers_example", +}); +console.log(response6); +---- diff --git a/docs/doc_examples/f6f647eb644a2d236637ff05f833cb73.asciidoc b/docs/doc_examples/f6f647eb644a2d236637ff05f833cb73.asciidoc index 81783cf66..b7fdbd587 100644 --- a/docs/doc_examples/f6f647eb644a2d236637ff05f833cb73.asciidoc +++ b/docs/doc_examples/f6f647eb644a2d236637ff05f833cb73.asciidoc @@ -3,7 +3,9 @@ [source, js] ---- -const response = await client.connector.secretPost({ +const response = await client.transport.request({ + method: "POST", + path: "/_connector/_secret", body: { value: "encoded_api_key", },