From ec3596b42dd4a3b72aee7ce862102a96a45f7254 Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Mon, 6 Jan 2025 20:51:38 +0000 Subject: [PATCH] Auto-generated API code --- ...0722b302b2b3275a988d858044f99d5d.asciidoc} | 7 +- ...074e4602d1ca54412380a40867d078bc.asciidoc} | 2 + .../082e78c7a2061a7c4a52b494e5ede0e8.asciidoc | 42 ++++++++++++ .../0e83f140237d75469a428ff403564bb5.asciidoc | 15 ----- .../1420a22aa817c7a996baaed0ad366d6f.asciidoc | 22 ------ .../246763219ec06172f7aa57bba28d344a.asciidoc | 67 +++++++++++++++++++ .../2a21674c40f9b182a8944769d20b2357.asciidoc | 26 +++++++ ...3312c82f81816bf76629db9582991812.asciidoc} | 1 + .../37f367ca81a16d3aef4ef7126ec33a2e.asciidoc | 67 +++++++++++++++++++ .../3ea4c971b3f47735dcc207ee2645fa03.asciidoc | 16 +++++ .../3f9dcf2aa42f3ecfb5ebfe48c1774103.asciidoc | 18 +++++ ...6b67c6121efb86ee100d40c2646f77b5.asciidoc} | 4 +- ...6fa02c2ad485bbe91f44b321158250f3.asciidoc} | 7 ++ .../730045fae3743c39b612813a42c330c3.asciidoc | 24 +++++++ .../7478ff69113fb53f41ea07cdf911fa67.asciidoc | 33 +++++++++ .../74b229a6e020113e5749099451979c89.asciidoc | 26 ------- .../7dd0d9cc6c5982a2c003d301e90feeba.asciidoc | 37 ++++++++++ .../8c639d3eef5c2de29e12bd9c6a42d3d4.asciidoc | 39 +++++++++++ .../9cc952d4a03264b700136cbc45abc8c6.asciidoc | 30 +++++++++ .../b590241c4296299b836fbb5a95bdd2dc.asciidoc | 18 +++++ .../b6d278737d27973e498ac61cda9e5126.asciidoc | 21 ++++++ .../bccd4eb26b1a325d103b12e198a13c08.asciidoc | 12 ++++ .../bdc55256fa5f701680631a149dbb75a9.asciidoc | 22 ++++++ .../bdd28276618235487ac96bd6679bc206.asciidoc | 31 +++++++++ ...df81b88a2192dd6f9912e0c948a44487.asciidoc} | 2 +- .../e375c7da666276c4df6664c6821cd5f4.asciidoc | 29 ++++++++ ...ec4b43c3ebd8816799fa004596b2f0cb.asciidoc} | 3 +- docs/reference.asciidoc | 14 ++-- 28 files changed, 557 insertions(+), 78 deletions(-) rename docs/doc_examples/{e20037f66bf54bcac7d10f536f031f34.asciidoc => 0722b302b2b3275a988d858044f99d5d.asciidoc} (53%) rename docs/doc_examples/{844928da2ff9a1394af5347a5e2e4f78.asciidoc => 074e4602d1ca54412380a40867d078bc.asciidoc} (85%) create mode 100644 docs/doc_examples/082e78c7a2061a7c4a52b494e5ede0e8.asciidoc delete mode 100644 docs/doc_examples/0e83f140237d75469a428ff403564bb5.asciidoc delete mode 100644 docs/doc_examples/1420a22aa817c7a996baaed0ad366d6f.asciidoc create mode 100644 docs/doc_examples/246763219ec06172f7aa57bba28d344a.asciidoc create mode 100644 docs/doc_examples/2a21674c40f9b182a8944769d20b2357.asciidoc rename docs/doc_examples/{23af230e824f48b9cd56a4cf973d788c.asciidoc => 3312c82f81816bf76629db9582991812.asciidoc} (93%) create mode 100644 docs/doc_examples/37f367ca81a16d3aef4ef7126ec33a2e.asciidoc create mode 100644 docs/doc_examples/3ea4c971b3f47735dcc207ee2645fa03.asciidoc create mode 100644 docs/doc_examples/3f9dcf2aa42f3ecfb5ebfe48c1774103.asciidoc rename docs/doc_examples/{34cdeefb09bbbe5206957a8bc1bd513d.asciidoc => 6b67c6121efb86ee100d40c2646f77b5.asciidoc} (69%) rename docs/doc_examples/{f9ee5d55a73f4c1fe7d507609047aefd.asciidoc => 6fa02c2ad485bbe91f44b321158250f3.asciidoc} (76%) create mode 100644 docs/doc_examples/730045fae3743c39b612813a42c330c3.asciidoc create mode 100644 docs/doc_examples/7478ff69113fb53f41ea07cdf911fa67.asciidoc delete mode 100644 docs/doc_examples/74b229a6e020113e5749099451979c89.asciidoc create mode 100644 docs/doc_examples/7dd0d9cc6c5982a2c003d301e90feeba.asciidoc create mode 100644 docs/doc_examples/8c639d3eef5c2de29e12bd9c6a42d3d4.asciidoc create mode 100644 docs/doc_examples/9cc952d4a03264b700136cbc45abc8c6.asciidoc create mode 100644 docs/doc_examples/b590241c4296299b836fbb5a95bdd2dc.asciidoc create mode 100644 docs/doc_examples/b6d278737d27973e498ac61cda9e5126.asciidoc create mode 100644 docs/doc_examples/bccd4eb26b1a325d103b12e198a13c08.asciidoc create mode 100644 docs/doc_examples/bdc55256fa5f701680631a149dbb75a9.asciidoc create mode 100644 docs/doc_examples/bdd28276618235487ac96bd6679bc206.asciidoc rename docs/doc_examples/{a225fc8c134cb21a85bc6025dac9368b.asciidoc => df81b88a2192dd6f9912e0c948a44487.asciidoc} (92%) create mode 100644 docs/doc_examples/e375c7da666276c4df6664c6821cd5f4.asciidoc rename docs/doc_examples/{2f07b81fd47ec3b074242a760f0c4e9e.asciidoc => ec4b43c3ebd8816799fa004596b2f0cb.asciidoc} (80%) diff --git a/docs/doc_examples/e20037f66bf54bcac7d10f536f031f34.asciidoc b/docs/doc_examples/0722b302b2b3275a988d858044f99d5d.asciidoc similarity index 53% rename from docs/doc_examples/e20037f66bf54bcac7d10f536f031f34.asciidoc rename to docs/doc_examples/0722b302b2b3275a988d858044f99d5d.asciidoc index 3b4f9251b..84abd3971 100644 --- a/docs/doc_examples/e20037f66bf54bcac7d10f536f031f34.asciidoc +++ b/docs/doc_examples/0722b302b2b3275a988d858044f99d5d.asciidoc @@ -3,11 +3,8 @@ [source, js] ---- -const response = await client.indices.putSettings({ - index: "my-index-000001", - settings: { - "index.blocks.read_only_allow_delete": null, - }, +const response = await client.indices.getMapping({ + index: "kibana_sample_data_ecommerce", }); console.log(response); ---- diff --git a/docs/doc_examples/844928da2ff9a1394af5347a5e2e4f78.asciidoc b/docs/doc_examples/074e4602d1ca54412380a40867d078bc.asciidoc similarity index 85% rename from docs/doc_examples/844928da2ff9a1394af5347a5e2e4f78.asciidoc rename to docs/doc_examples/074e4602d1ca54412380a40867d078bc.asciidoc index b0acfaa1d..9d98d539a 100644 --- a/docs/doc_examples/844928da2ff9a1394af5347a5e2e4f78.asciidoc +++ b/docs/doc_examples/074e4602d1ca54412380a40867d078bc.asciidoc @@ -11,6 +11,8 @@ const response = await client.indices.putSettings({ "index.indexing.slowlog.threshold.index.debug": "2s", "index.indexing.slowlog.threshold.index.trace": "500ms", "index.indexing.slowlog.source": "1000", + "index.indexing.slowlog.reformat": true, + "index.indexing.slowlog.include.user": true, }, }); console.log(response); diff --git a/docs/doc_examples/082e78c7a2061a7c4a52b494e5ede0e8.asciidoc b/docs/doc_examples/082e78c7a2061a7c4a52b494e5ede0e8.asciidoc new file mode 100644 index 000000000..269067032 --- /dev/null +++ b/docs/doc_examples/082e78c7a2061a7c4a52b494e5ede0e8.asciidoc @@ -0,0 +1,42 @@ +// 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-rank-vectors-bit", + mappings: { + properties: { + my_vector: { + type: "rank_vectors", + element_type: "bit", + }, + }, + }, +}); +console.log(response); + +const response1 = await client.bulk({ + index: "my-rank-vectors-bit", + refresh: "true", + operations: [ + { + index: { + _id: "1", + }, + }, + { + my_vector: [127, -127, 0, 1, 42], + }, + { + index: { + _id: "2", + }, + }, + { + my_vector: "8100012a7f", + }, + ], +}); +console.log(response1); +---- diff --git a/docs/doc_examples/0e83f140237d75469a428ff403564bb5.asciidoc b/docs/doc_examples/0e83f140237d75469a428ff403564bb5.asciidoc deleted file mode 100644 index aac173f77..000000000 --- a/docs/doc_examples/0e83f140237d75469a428ff403564bb5.asciidoc +++ /dev/null @@ -1,15 +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.routing.allocation.disk.watermark.low": "100gb", - "cluster.routing.allocation.disk.watermark.high": "50gb", - "cluster.routing.allocation.disk.watermark.flood_stage": "10gb", - "cluster.info.update.interval": "1m", - }, -}); -console.log(response); ----- diff --git a/docs/doc_examples/1420a22aa817c7a996baaed0ad366d6f.asciidoc b/docs/doc_examples/1420a22aa817c7a996baaed0ad366d6f.asciidoc deleted file mode 100644 index ce7709b43..000000000 --- a/docs/doc_examples/1420a22aa817c7a996baaed0ad366d6f.asciidoc +++ /dev/null @@ -1,22 +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.search({ - index: "test-index", - query: { - nested: { - path: "inference_field.inference.chunks", - query: { - sparse_vector: { - field: "inference_field.inference.chunks.embeddings", - inference_id: "my-inference-id", - query: "mountain lake", - }, - }, - }, - }, -}); -console.log(response); ----- diff --git a/docs/doc_examples/246763219ec06172f7aa57bba28d344a.asciidoc b/docs/doc_examples/246763219ec06172f7aa57bba28d344a.asciidoc new file mode 100644 index 000000000..deabe9511 --- /dev/null +++ b/docs/doc_examples/246763219ec06172f7aa57bba28d344a.asciidoc @@ -0,0 +1,67 @@ +// 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-rank-vectors-bit", + mappings: { + properties: { + my_vector: { + type: "rank_vectors", + element_type: "bit", + }, + }, + }, +}); +console.log(response); + +const response1 = await client.bulk({ + index: "my-rank-vectors-bit", + refresh: "true", + operations: [ + { + index: { + _id: "1", + }, + }, + { + my_vector: [127, -127, 0, 1, 42], + }, + { + index: { + _id: "2", + }, + }, + { + my_vector: "8100012a7f", + }, + ], +}); +console.log(response1); + +const response2 = await client.search({ + index: "my-rank-vectors-bit", + query: { + script_score: { + query: { + match_all: {}, + }, + script: { + source: "maxSimDotProduct(params.query_vector, 'my_vector')", + params: { + query_vector: [ + [ + 0.35, 0.77, 0.95, 0.15, 0.11, 0.08, 0.58, 0.06, 0.44, 0.52, 0.21, + 0.62, 0.65, 0.16, 0.64, 0.39, 0.93, 0.06, 0.93, 0.31, 0.92, 0, + 0.66, 0.86, 0.92, 0.03, 0.81, 0.31, 0.2, 0.92, 0.95, 0.64, 0.19, + 0.26, 0.77, 0.64, 0.78, 0.32, 0.97, 0.84, + ], + ], + }, + }, + }, + }, +}); +console.log(response2); +---- diff --git a/docs/doc_examples/2a21674c40f9b182a8944769d20b2357.asciidoc b/docs/doc_examples/2a21674c40f9b182a8944769d20b2357.asciidoc new file mode 100644 index 000000000..07c3eb29d --- /dev/null +++ b/docs/doc_examples/2a21674c40f9b182a8944769d20b2357.asciidoc @@ -0,0 +1,26 @@ +// 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-rank-vectors-float", + query: { + script_score: { + query: { + match_all: {}, + }, + script: { + source: "maxSimDotProduct(params.query_vector, 'my_vector')", + params: { + query_vector: [ + [0.5, 10, 6], + [-0.5, 10, 10], + ], + }, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/23af230e824f48b9cd56a4cf973d788c.asciidoc b/docs/doc_examples/3312c82f81816bf76629db9582991812.asciidoc similarity index 93% rename from docs/doc_examples/23af230e824f48b9cd56a4cf973d788c.asciidoc rename to docs/doc_examples/3312c82f81816bf76629db9582991812.asciidoc index 693b70a4f..f1ba5e168 100644 --- a/docs/doc_examples/23af230e824f48b9cd56a4cf973d788c.asciidoc +++ b/docs/doc_examples/3312c82f81816bf76629db9582991812.asciidoc @@ -14,6 +14,7 @@ const response = await client.indices.putSettings({ "index.search.slowlog.threshold.fetch.info": "800ms", "index.search.slowlog.threshold.fetch.debug": "500ms", "index.search.slowlog.threshold.fetch.trace": "200ms", + "index.search.slowlog.include.user": true, }, }); console.log(response); diff --git a/docs/doc_examples/37f367ca81a16d3aef4ef7126ec33a2e.asciidoc b/docs/doc_examples/37f367ca81a16d3aef4ef7126ec33a2e.asciidoc new file mode 100644 index 000000000..8651f44c6 --- /dev/null +++ b/docs/doc_examples/37f367ca81a16d3aef4ef7126ec33a2e.asciidoc @@ -0,0 +1,67 @@ +// 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: "movies", + size: 10, + retriever: { + rescorer: { + rescore: { + query: { + window_size: 50, + rescore_query: { + script_score: { + script: { + source: + "cosineSimilarity(params.queryVector, 'product-vector_final_stage') + 1.0", + params: { + queryVector: [-0.5, 90, -10, 14.8, -156], + }, + }, + }, + }, + }, + }, + retriever: { + rrf: { + rank_window_size: 100, + retrievers: [ + { + standard: { + query: { + sparse_vector: { + field: "plot_embedding", + inference_id: "my-elser-model", + query: "films that explore psychological depths", + }, + }, + }, + }, + { + standard: { + query: { + multi_match: { + query: "crime", + fields: ["plot", "title"], + }, + }, + }, + }, + { + knn: { + field: "vector", + query_vector: [10, 22, 77], + k: 10, + num_candidates: 10, + }, + }, + ], + }, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/3ea4c971b3f47735dcc207ee2645fa03.asciidoc b/docs/doc_examples/3ea4c971b3f47735dcc207ee2645fa03.asciidoc new file mode 100644 index 000000000..32f004a99 --- /dev/null +++ b/docs/doc_examples/3ea4c971b3f47735dcc207ee2645fa03.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.indices.updateAliases({ + actions: [ + { + remove_index: { + index: "my-index-2099.05.06-000001", + }, + }, + ], +}); +console.log(response); +---- diff --git a/docs/doc_examples/3f9dcf2aa42f3ecfb5ebfe48c1774103.asciidoc b/docs/doc_examples/3f9dcf2aa42f3ecfb5ebfe48c1774103.asciidoc new file mode 100644 index 000000000..7818a3f0c --- /dev/null +++ b/docs/doc_examples/3f9dcf2aa42f3ecfb5ebfe48c1774103.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: "kibana_sample_data_ecommerce", + size: 0, + aggs: { + order_stats: { + stats: { + field: "taxful_total_price", + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/34cdeefb09bbbe5206957a8bc1bd513d.asciidoc b/docs/doc_examples/6b67c6121efb86ee100d40c2646f77b5.asciidoc similarity index 69% rename from docs/doc_examples/34cdeefb09bbbe5206957a8bc1bd513d.asciidoc rename to docs/doc_examples/6b67c6121efb86ee100d40c2646f77b5.asciidoc index 9537a8386..3226a57c7 100644 --- a/docs/doc_examples/34cdeefb09bbbe5206957a8bc1bd513d.asciidoc +++ b/docs/doc_examples/6b67c6121efb86ee100d40c2646f77b5.asciidoc @@ -4,9 +4,11 @@ [source, js] ---- const response = await client.indices.putSettings({ - index: "my-index-000001", + index: "*", settings: { "index.search.slowlog.include.user": true, + "index.search.slowlog.threshold.fetch.warn": "30s", + "index.search.slowlog.threshold.query.warn": "30s", }, }); console.log(response); diff --git a/docs/doc_examples/f9ee5d55a73f4c1fe7d507609047aefd.asciidoc b/docs/doc_examples/6fa02c2ad485bbe91f44b321158250f3.asciidoc similarity index 76% rename from docs/doc_examples/f9ee5d55a73f4c1fe7d507609047aefd.asciidoc rename to docs/doc_examples/6fa02c2ad485bbe91f44b321158250f3.asciidoc index 0c7b48ea7..afea3d985 100644 --- a/docs/doc_examples/f9ee5d55a73f4c1fe7d507609047aefd.asciidoc +++ b/docs/doc_examples/6fa02c2ad485bbe91f44b321158250f3.asciidoc @@ -12,6 +12,13 @@ const response = await client.search({ fields: ["my_field", "my_field._2gram", "my_field._3gram"], }, }, + highlight: { + fields: { + my_field: { + matched_fields: ["my_field._index_prefix"], + }, + }, + }, }); console.log(response); ---- diff --git a/docs/doc_examples/730045fae3743c39b612813a42c330c3.asciidoc b/docs/doc_examples/730045fae3743c39b612813a42c330c3.asciidoc new file mode 100644 index 000000000..b2400e39b --- /dev/null +++ b/docs/doc_examples/730045fae3743c39b612813a42c330c3.asciidoc @@ -0,0 +1,24 @@ +// 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-000001", + query: { + prefix: { + full_name: { + value: "ki", + }, + }, + }, + highlight: { + fields: { + full_name: { + matched_fields: ["full_name._index_prefix"], + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/7478ff69113fb53f41ea07cdf911fa67.asciidoc b/docs/doc_examples/7478ff69113fb53f41ea07cdf911fa67.asciidoc new file mode 100644 index 000000000..047487632 --- /dev/null +++ b/docs/doc_examples/7478ff69113fb53f41ea07cdf911fa67.asciidoc @@ -0,0 +1,33 @@ +// 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: "kibana_sample_data_ecommerce", + size: 0, + aggs: { + daily_sales: { + date_histogram: { + field: "order_date", + calendar_interval: "day", + }, + aggs: { + daily_revenue: { + sum: { + field: "taxful_total_price", + }, + }, + smoothed_revenue: { + moving_fn: { + buckets_path: "daily_revenue", + window: 3, + script: "MovingFunctions.unweightedAvg(values)", + }, + }, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/74b229a6e020113e5749099451979c89.asciidoc b/docs/doc_examples/74b229a6e020113e5749099451979c89.asciidoc deleted file mode 100644 index b99aa857f..000000000 --- a/docs/doc_examples/74b229a6e020113e5749099451979c89.asciidoc +++ /dev/null @@ -1,26 +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.search({ - index: "test-index", - query: { - nested: { - path: "inference_field.inference.chunks", - query: { - knn: { - field: "inference_field.inference.chunks.embeddings", - query_vector_builder: { - text_embedding: { - model_id: "my_inference_id", - model_text: "mountain lake", - }, - }, - }, - }, - }, - }, -}); -console.log(response); ----- diff --git a/docs/doc_examples/7dd0d9cc6c5982a2c003d301e90feeba.asciidoc b/docs/doc_examples/7dd0d9cc6c5982a2c003d301e90feeba.asciidoc new file mode 100644 index 000000000..733c366ba --- /dev/null +++ b/docs/doc_examples/7dd0d9cc6c5982a2c003d301e90feeba.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: "kibana_sample_data_ecommerce", + size: 0, + aggs: { + daily_sales: { + date_histogram: { + field: "order_date", + calendar_interval: "day", + format: "yyyy-MM-dd", + }, + aggs: { + revenue: { + sum: { + field: "taxful_total_price", + }, + }, + unique_customers: { + cardinality: { + field: "customer_id", + }, + }, + avg_basket_size: { + avg: { + field: "total_quantity", + }, + }, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/8c639d3eef5c2de29e12bd9c6a42d3d4.asciidoc b/docs/doc_examples/8c639d3eef5c2de29e12bd9c6a42d3d4.asciidoc new file mode 100644 index 000000000..aa09492cf --- /dev/null +++ b/docs/doc_examples/8c639d3eef5c2de29e12bd9c6a42d3d4.asciidoc @@ -0,0 +1,39 @@ +// 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: "kibana_sample_data_ecommerce", + size: 0, + aggs: { + categories: { + terms: { + field: "category.keyword", + size: 5, + order: { + total_revenue: "desc", + }, + }, + aggs: { + total_revenue: { + sum: { + field: "taxful_total_price", + }, + }, + avg_order_value: { + avg: { + field: "taxful_total_price", + }, + }, + total_items: { + sum: { + field: "total_quantity", + }, + }, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/9cc952d4a03264b700136cbc45abc8c6.asciidoc b/docs/doc_examples/9cc952d4a03264b700136cbc45abc8c6.asciidoc new file mode 100644 index 000000000..1bc8b2cc7 --- /dev/null +++ b/docs/doc_examples/9cc952d4a03264b700136cbc45abc8c6.asciidoc @@ -0,0 +1,30 @@ +// 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-rank-vectors-byte", + mappings: { + properties: { + my_vector: { + type: "rank_vectors", + element_type: "byte", + }, + }, + }, +}); +console.log(response); + +const response1 = await client.index({ + index: "my-rank-vectors-byte", + id: 1, + document: { + my_vector: [ + [1, 2, 3], + [4, 5, 6], + ], + }, +}); +console.log(response1); +---- diff --git a/docs/doc_examples/b590241c4296299b836fbb5a95bdd2dc.asciidoc b/docs/doc_examples/b590241c4296299b836fbb5a95bdd2dc.asciidoc new file mode 100644 index 000000000..f71aebf61 --- /dev/null +++ b/docs/doc_examples/b590241c4296299b836fbb5a95bdd2dc.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: "kibana_sample_data_ecommerce", + size: 0, + aggs: { + avg_order_value: { + avg: { + field: "taxful_total_price", + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/b6d278737d27973e498ac61cda9e5126.asciidoc b/docs/doc_examples/b6d278737d27973e498ac61cda9e5126.asciidoc new file mode 100644 index 000000000..446bba938 --- /dev/null +++ b/docs/doc_examples/b6d278737d27973e498ac61cda9e5126.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.search({ + index: "kibana_sample_data_ecommerce", + size: 0, + aggs: { + daily_orders: { + date_histogram: { + field: "order_date", + calendar_interval: "day", + format: "yyyy-MM-dd", + min_doc_count: 0, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/bccd4eb26b1a325d103b12e198a13c08.asciidoc b/docs/doc_examples/bccd4eb26b1a325d103b12e198a13c08.asciidoc new file mode 100644 index 000000000..e63a33d34 --- /dev/null +++ b/docs/doc_examples/bccd4eb26b1a325d103b12e198a13c08.asciidoc @@ -0,0 +1,12 @@ +// 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.getSettings({ + index: "_all", + expand_wildcards: "all", + filter_path: "*.settings.index.*.slowlog", +}); +console.log(response); +---- diff --git a/docs/doc_examples/bdc55256fa5f701680631a149dbb75a9.asciidoc b/docs/doc_examples/bdc55256fa5f701680631a149dbb75a9.asciidoc new file mode 100644 index 000000000..4e074487d --- /dev/null +++ b/docs/doc_examples/bdc55256fa5f701680631a149dbb75a9.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.search({ + index: "kibana_sample_data_ecommerce", + size: 0, + aggs: { + sales_by_category: { + terms: { + field: "category.keyword", + size: 5, + order: { + _count: "desc", + }, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/bdd28276618235487ac96bd6679bc206.asciidoc b/docs/doc_examples/bdd28276618235487ac96bd6679bc206.asciidoc new file mode 100644 index 000000000..b518cae85 --- /dev/null +++ b/docs/doc_examples/bdd28276618235487ac96bd6679bc206.asciidoc @@ -0,0 +1,31 @@ +// 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: "kibana_sample_data_ecommerce", + size: 0, + aggs: { + daily_sales: { + date_histogram: { + field: "order_date", + calendar_interval: "day", + }, + aggs: { + revenue: { + sum: { + field: "taxful_total_price", + }, + }, + cumulative_revenue: { + cumulative_sum: { + buckets_path: "revenue", + }, + }, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/a225fc8c134cb21a85bc6025dac9368b.asciidoc b/docs/doc_examples/df81b88a2192dd6f9912e0c948a44487.asciidoc similarity index 92% rename from docs/doc_examples/a225fc8c134cb21a85bc6025dac9368b.asciidoc rename to docs/doc_examples/df81b88a2192dd6f9912e0c948a44487.asciidoc index da9071e2c..d4a4521d5 100644 --- a/docs/doc_examples/a225fc8c134cb21a85bc6025dac9368b.asciidoc +++ b/docs/doc_examples/df81b88a2192dd6f9912e0c948a44487.asciidoc @@ -7,7 +7,7 @@ const response = await client.inference.put({ task_type: "sparse_embedding", inference_id: "elser_embeddings", inference_config: { - service: "elser", + service: "elasticsearch", service_settings: { num_allocations: 1, num_threads: 1, diff --git a/docs/doc_examples/e375c7da666276c4df6664c6821cd5f4.asciidoc b/docs/doc_examples/e375c7da666276c4df6664c6821cd5f4.asciidoc new file mode 100644 index 000000000..da7018754 --- /dev/null +++ b/docs/doc_examples/e375c7da666276c4df6664c6821cd5f4.asciidoc @@ -0,0 +1,29 @@ +// 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-rank-vectors-float", + mappings: { + properties: { + my_vector: { + type: "rank_vectors", + }, + }, + }, +}); +console.log(response); + +const response1 = await client.index({ + index: "my-rank-vectors-float", + id: 1, + document: { + my_vector: [ + [0.5, 10, 6], + [-0.5, 10, 10], + ], + }, +}); +console.log(response1); +---- diff --git a/docs/doc_examples/2f07b81fd47ec3b074242a760f0c4e9e.asciidoc b/docs/doc_examples/ec4b43c3ebd8816799fa004596b2f0cb.asciidoc similarity index 80% rename from docs/doc_examples/2f07b81fd47ec3b074242a760f0c4e9e.asciidoc rename to docs/doc_examples/ec4b43c3ebd8816799fa004596b2f0cb.asciidoc index d2f122662..5c1d8b6ed 100644 --- a/docs/doc_examples/2f07b81fd47ec3b074242a760f0c4e9e.asciidoc +++ b/docs/doc_examples/ec4b43c3ebd8816799fa004596b2f0cb.asciidoc @@ -4,9 +4,10 @@ [source, js] ---- const response = await client.indices.putSettings({ - index: "my-index-000001", + index: "*", settings: { "index.indexing.slowlog.include.user": true, + "index.indexing.slowlog.threshold.index.warn": "30s", }, }); console.log(response); diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index 51cb7d989..5cb5a8062 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -6090,7 +6090,7 @@ Deletes all job results, model snapshots and forecast data that have exceeded their retention days period. Machine learning state documents that are not associated with any job are also deleted. You can limit the request to a single or set of anomaly detection jobs by -using a job identifier, a group name, a comma-separated list of jobs, or a +using a job identifier, a group name, a list of jobs, or a wildcard expression. You can delete expired data for all anomaly detection jobs by using _all, by specifying * as the , or by omitting the . @@ -6501,7 +6501,7 @@ This parameter has the `from` and `size` properties. ==== get_data_frame_analytics Retrieves configuration information for data frame analytics jobs. You can get information for multiple data frame analytics jobs in a single -API request by using a comma-separated list of data frame analytics jobs or a +API request by using a list of data frame analytics jobs or a wildcard expression. {ref}/get-dfanalytics.html[Endpoint documentation] @@ -6570,7 +6570,7 @@ there are no matches or only partial matches. ==== get_datafeed_stats Retrieves usage information for datafeeds. You can get statistics for multiple datafeeds in a single API request by -using a comma-separated list of datafeeds or a wildcard expression. You can +using a list of datafeeds or a wildcard expression. You can get statistics for all datafeeds by using `_all`, by specifying `*` as the ``, or by omitting the ``. If the datafeed is stopped, the only information you receive is the `datafeed_id` and the `state`. @@ -6604,7 +6604,7 @@ partial matches. If this parameter is `false`, the request returns a ==== get_datafeeds Retrieves configuration information for datafeeds. You can get information for multiple datafeeds in a single API request by -using a comma-separated list of datafeeds or a wildcard expression. You can +using a list of datafeeds or a wildcard expression. You can get information for all datafeeds by using `_all`, by specifying `*` as the ``, or by omitting the ``. This API returns a maximum of 10,000 datafeeds. @@ -6723,7 +6723,7 @@ code when there are no matches or only partial matches. ==== get_jobs Retrieves configuration information for anomaly detection jobs. You can get information for multiple anomaly detection jobs in a single API -request by using a group name, a comma-separated list of jobs, or a wildcard +request by using a group name, a list of jobs, or a wildcard expression. You can get information for all anomaly detection jobs by using `_all`, by specifying `*` as the ``, or by omitting the ``. @@ -6954,7 +6954,7 @@ tags are returned. [discrete] ==== get_trained_models_stats Retrieves usage information for trained models. You can get usage information for multiple trained -models in a single API request by using a comma-separated list of model IDs or a wildcard expression. +models in a single API request by using a list of model IDs or a wildcard expression. {ref}/get-trained-models-stats.html[Endpoint documentation] [source,ts] @@ -7063,7 +7063,7 @@ client.ml.postCalendarEvents({ calendar_id, events }) Sends data to an anomaly detection job for analysis. IMPORTANT: For each job, data can be accepted from only a single connection at a time. -It is not currently possible to post data to multiple jobs using wildcards or a comma-separated list. +It is not currently possible to post data to multiple jobs using wildcards or a list. {ref}/ml-post-data.html[Endpoint documentation] [source,ts]