diff --git a/docs/doc_examples/00ad41bde67beac991534ae0e04b1296.asciidoc b/docs/doc_examples/00ad41bde67beac991534ae0e04b1296.asciidoc new file mode 100644 index 000000000..aad48ff29 --- /dev/null +++ b/docs/doc_examples/00ad41bde67beac991534ae0e04b1296.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.indices.getDataStream({ + name: "my-data-stream", + filter_path: "data_streams.indices.index_name", +}); +console.log(response); +---- diff --git a/docs/doc_examples/0f028f71f04c1d569fab402869565a84.asciidoc b/docs/doc_examples/0f028f71f04c1d569fab402869565a84.asciidoc new file mode 100644 index 000000000..007f558d8 --- /dev/null +++ b/docs/doc_examples/0f028f71f04c1d569fab402869565a84.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.indices.putSettings({ + index: ".reindexed-v9-ml-anomalies-custom-example", + settings: { + index: { + number_of_replicas: "", + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/12adea5d76f73d94d80d42f53f67563f.asciidoc b/docs/doc_examples/12adea5d76f73d94d80d42f53f67563f.asciidoc new file mode 100644 index 000000000..83d87f9c6 --- /dev/null +++ b/docs/doc_examples/12adea5d76f73d94d80d42f53f67563f.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.indices.addBlock({ + index: ".ml-anomalies-custom-example", + block: "read_only", +}); +console.log(response); +---- diff --git a/docs/doc_examples/1ead35c954963e83f89872048dabdbe9.asciidoc b/docs/doc_examples/1ead35c954963e83f89872048dabdbe9.asciidoc new file mode 100644 index 000000000..347f3152e --- /dev/null +++ b/docs/doc_examples/1ead35c954963e83f89872048dabdbe9.asciidoc @@ -0,0 +1,19 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.security.queryRole({ + query: { + bool: { + must_not: { + term: { + "metadata._reserved": true, + }, + }, + }, + }, + sort: ["name"], +}); +console.log(response); +---- diff --git a/docs/doc_examples/272e27bf1fcc4fe5dbd4092679dd0342.asciidoc b/docs/doc_examples/272e27bf1fcc4fe5dbd4092679dd0342.asciidoc new file mode 100644 index 000000000..5a65c9753 --- /dev/null +++ b/docs/doc_examples/272e27bf1fcc4fe5dbd4092679dd0342.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.indices.addBlock({ + index: ".ml-anomalies-custom-example", + block: "write", +}); +console.log(response); +---- diff --git a/docs/doc_examples/d29031409016b2b798148ef173a196ae.asciidoc b/docs/doc_examples/2afd49985950cbcccf727fa858d00067.asciidoc similarity index 83% rename from docs/doc_examples/d29031409016b2b798148ef173a196ae.asciidoc rename to docs/doc_examples/2afd49985950cbcccf727fa858d00067.asciidoc index fac02d172..38aa159a8 100644 --- a/docs/doc_examples/d29031409016b2b798148ef173a196ae.asciidoc +++ b/docs/doc_examples/2afd49985950cbcccf727fa858d00067.asciidoc @@ -6,13 +6,13 @@ const response = await client.indices.create({ index: "test-index", query: { - semantic: { - field: "my_semantic_field", + match: { + my_field: "Which country is Paris in?", }, }, highlight: { fields: { - my_semantic_field: { + my_field: { type: "semantic", number_of_fragments: 2, order: "score", diff --git a/docs/doc_examples/31832bd71c31c46a1ccf8d1c210d89d4.asciidoc b/docs/doc_examples/31832bd71c31c46a1ccf8d1c210d89d4.asciidoc new file mode 100644 index 000000000..e61007e9c --- /dev/null +++ b/docs/doc_examples/31832bd71c31c46a1ccf8d1c210d89d4.asciidoc @@ -0,0 +1,28 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + index: "my-index-*", + query: { + bool: { + must: [ + { + match: { + "user.id": "kimchy", + }, + }, + ], + must_not: [ + { + terms: { + _index: ["my-index-01"], + }, + }, + ], + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/32c8c86702ccd68eb70f1573409c2a1f.asciidoc b/docs/doc_examples/32c8c86702ccd68eb70f1573409c2a1f.asciidoc new file mode 100644 index 000000000..dcc8ff429 --- /dev/null +++ b/docs/doc_examples/32c8c86702ccd68eb70f1573409c2a1f.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.ilm.putLifecycle({ + name: "my_policy", + policy: { + phases: { + hot: { + actions: { + rollover: { + max_primary_shard_size: "50gb", + }, + searchable_snapshot: { + snapshot_repository: "backing_repo", + replicate_for: "14d", + }, + }, + }, + delete: { + min_age: "28d", + actions: { + delete: {}, + }, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/37f367ca81a16d3aef4ef7126ec33a2e.asciidoc b/docs/doc_examples/36792c81c053e0555407d1e83e7e054f.asciidoc similarity index 94% rename from docs/doc_examples/37f367ca81a16d3aef4ef7126ec33a2e.asciidoc rename to docs/doc_examples/36792c81c053e0555407d1e83e7e054f.asciidoc index 8651f44c6..2256f4c94 100644 --- a/docs/doc_examples/37f367ca81a16d3aef4ef7126ec33a2e.asciidoc +++ b/docs/doc_examples/36792c81c053e0555407d1e83e7e054f.asciidoc @@ -9,10 +9,13 @@ const response = await client.search({ retriever: { rescorer: { rescore: { + window_size: 50, query: { - window_size: 50, rescore_query: { script_score: { + query: { + match_all: {}, + }, script: { source: "cosineSimilarity(params.queryVector, 'product-vector_final_stage') + 1.0", diff --git a/docs/doc_examples/3722dad876023e0757138dd5a6d3240e.asciidoc b/docs/doc_examples/3722dad876023e0757138dd5a6d3240e.asciidoc new file mode 100644 index 000000000..e071509a9 --- /dev/null +++ b/docs/doc_examples/3722dad876023e0757138dd5a6d3240e.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: "my-index", + settings: { + index: { + number_of_shards: 3, + "blocks.write": true, + }, + }, + mappings: { + properties: { + field1: { + type: "text", + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/3a204b57072a104d9b50f3a9e064a8f6.asciidoc b/docs/doc_examples/3a204b57072a104d9b50f3a9e064a8f6.asciidoc new file mode 100644 index 000000000..087b6dc1b --- /dev/null +++ b/docs/doc_examples/3a204b57072a104d9b50f3a9e064a8f6.asciidoc @@ -0,0 +1,19 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + index: ".ml-anomalies-custom-example", + size: 0, + aggs: { + job_ids: { + terms: { + field: "job_id", + size: 100, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/3bc4a3681e3ea9cb3de49f72085807d8.asciidoc b/docs/doc_examples/3bc4a3681e3ea9cb3de49f72085807d8.asciidoc new file mode 100644 index 000000000..929ab0ee8 --- /dev/null +++ b/docs/doc_examples/3bc4a3681e3ea9cb3de49f72085807d8.asciidoc @@ -0,0 +1,61 @@ +// 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: { + linear: { + retrievers: [ + { + retriever: { + standard: { + query: { + function_score: { + query: { + term: { + topic: "ai", + }, + }, + functions: [ + { + script_score: { + script: { + source: "doc['timestamp'].value.millis", + }, + }, + }, + ], + boost_mode: "replace", + }, + }, + sort: { + timestamp: { + order: "asc", + }, + }, + }, + }, + weight: 2, + normalizer: "minmax", + }, + { + retriever: { + knn: { + field: "vector", + query_vector: [0.23, 0.67, 0.89], + k: 3, + num_candidates: 5, + }, + }, + weight: 1.5, + }, + ], + rank_window_size: 10, + }, + }, + _source: false, +}); +console.log(response); +---- diff --git a/docs/doc_examples/4de4bb55bbc0a76c75d256f245a3ee3f.asciidoc b/docs/doc_examples/4de4bb55bbc0a76c75d256f245a3ee3f.asciidoc new file mode 100644 index 000000000..22100f235 --- /dev/null +++ b/docs/doc_examples/4de4bb55bbc0a76c75d256f245a3ee3f.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: "elser-model-eis", + inference_config: { + service: "elastic", + service_settings: { + model_name: "elser", + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/537bce129338d9227bccb6a0283dab45.asciidoc b/docs/doc_examples/537bce129338d9227bccb6a0283dab45.asciidoc new file mode 100644 index 000000000..cfeed0dff --- /dev/null +++ b/docs/doc_examples/537bce129338d9227bccb6a0283dab45.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.cluster.putSettings({ + persistent: { + "migrate.data_stream_reindex_max_request_per_second": 10000, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/59aa5216630f80c5dc298fc5bba4a819.asciidoc b/docs/doc_examples/59aa5216630f80c5dc298fc5bba4a819.asciidoc new file mode 100644 index 000000000..61ac89373 --- /dev/null +++ b/docs/doc_examples/59aa5216630f80c5dc298fc5bba4a819.asciidoc @@ -0,0 +1,10 @@ +// 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: ".reindexed-v9-ml-anomalies-custom-example", +}); +console.log(response); +---- diff --git a/docs/doc_examples/6baf72c04d48cb04c2f8be609ff3b3b5.asciidoc b/docs/doc_examples/6baf72c04d48cb04c2f8be609ff3b3b5.asciidoc new file mode 100644 index 000000000..41c42d206 --- /dev/null +++ b/docs/doc_examples/6baf72c04d48cb04c2f8be609ff3b3b5.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.search({ + index: "test-index", + query: { + match: { + my_semantic_field: "Which country is Paris in?", + }, + }, + highlight: { + fields: { + my_semantic_field: { + number_of_fragments: 2, + order: "score", + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/6e498b9dc753b94abf2618c407fa5cd8.asciidoc b/docs/doc_examples/6e498b9dc753b94abf2618c407fa5cd8.asciidoc new file mode 100644 index 000000000..fdd6ab8f3 --- /dev/null +++ b/docs/doc_examples/6e498b9dc753b94abf2618c407fa5cd8.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.reindex({ + wait_for_completion: "false", + source: { + index: ".ml-anomalies-custom-example", + }, + dest: { + index: ".reindexed-v9-ml-anomalies-custom-example", + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/8621c05cc7cf3880bde751f6670a0c3a.asciidoc b/docs/doc_examples/8621c05cc7cf3880bde751f6670a0c3a.asciidoc new file mode 100644 index 000000000..7cb4b44d1 --- /dev/null +++ b/docs/doc_examples/8621c05cc7cf3880bde751f6670a0c3a.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.indices.putSettings({ + index: ".reindexed-v9-ml-anomalies-custom-example", + settings: { + index: { + number_of_replicas: 0, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/89f547649895176c246bb8c41313ff21.asciidoc b/docs/doc_examples/89f547649895176c246bb8c41313ff21.asciidoc new file mode 100644 index 000000000..571f64436 --- /dev/null +++ b/docs/doc_examples/89f547649895176c246bb8c41313ff21.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.esql.query({ + query: + '\nFROM library\n| EVAL year = DATE_EXTRACT("year", release_date)\n| WHERE page_count > ? AND match(author, ?, {"minimum_should_match": ?})\n| LIMIT 5\n', + params: [300, "Frank Herbert", 2], +}); +console.log(response); +---- diff --git a/docs/doc_examples/8c47c80139f40f25db44f5781ca2dfbe.asciidoc b/docs/doc_examples/8c47c80139f40f25db44f5781ca2dfbe.asciidoc new file mode 100644 index 000000000..680f24481 --- /dev/null +++ b/docs/doc_examples/8c47c80139f40f25db44f5781ca2dfbe.asciidoc @@ -0,0 +1,10 @@ +// 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.getAlias({ + index: ".ml-anomalies-custom-example", +}); +console.log(response); +---- diff --git a/docs/doc_examples/a46f566ca031375658c22f89b87dc6d2.asciidoc b/docs/doc_examples/a46f566ca031375658c22f89b87dc6d2.asciidoc new file mode 100644 index 000000000..f11302fa4 --- /dev/null +++ b/docs/doc_examples/a46f566ca031375658c22f89b87dc6d2.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.cat.indices({ + index: ".ml-anomalies-custom-example", + v: "true", + h: "index,store.size", +}); +console.log(response); +---- diff --git a/docs/doc_examples/a675fafa7c688cb3ea1be09bf887ebf0.asciidoc b/docs/doc_examples/a675fafa7c688cb3ea1be09bf887ebf0.asciidoc new file mode 100644 index 000000000..2837854a9 --- /dev/null +++ b/docs/doc_examples/a675fafa7c688cb3ea1be09bf887ebf0.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.get({ + index: ".migrated-ds-my-data-stream-2025.01.23-000001", + human: "true", + filter_path: "*.settings.index.version.created_string", +}); +console.log(response); +---- diff --git a/docs/doc_examples/357edc9d10e98ed776401c7a439a1a55.asciidoc b/docs/doc_examples/ba0e7e0b18fc9ec6c623d40186d1f61b.asciidoc similarity index 94% rename from docs/doc_examples/357edc9d10e98ed776401c7a439a1a55.asciidoc rename to docs/doc_examples/ba0e7e0b18fc9ec6c623d40186d1f61b.asciidoc index 088bda3bc..42c6d4763 100644 --- a/docs/doc_examples/357edc9d10e98ed776401c7a439a1a55.asciidoc +++ b/docs/doc_examples/ba0e7e0b18fc9ec6c623d40186d1f61b.asciidoc @@ -6,6 +6,7 @@ const response = await client.indices.resolveCluster({ name: "not-present,clust*:my-index*,oldcluster:*", ignore_unavailable: "false", + timeout: "5s", }); console.log(response); ---- diff --git a/docs/doc_examples/436d50b85fc8f0977d02059eec00719b.asciidoc b/docs/doc_examples/bcd1afb793240b1dddd9fa5d3f21192b.asciidoc similarity index 65% rename from docs/doc_examples/436d50b85fc8f0977d02059eec00719b.asciidoc rename to docs/doc_examples/bcd1afb793240b1dddd9fa5d3f21192b.asciidoc index d1a2f84de..5dc68e409 100644 --- a/docs/doc_examples/436d50b85fc8f0977d02059eec00719b.asciidoc +++ b/docs/doc_examples/bcd1afb793240b1dddd9fa5d3f21192b.asciidoc @@ -6,15 +6,11 @@ const response = await client.update({ index: "test", id: 1, - script: { - source: "ctx._source.counter += params.count", - lang: "painless", - params: { - count: 4, - }, + doc: { + product_price: 100, }, upsert: { - counter: 1, + product_price: 50, }, }); console.log(response); diff --git a/docs/doc_examples/c3b77e11b16e37e9e37e28dec922432e.asciidoc b/docs/doc_examples/c3b77e11b16e37e9e37e28dec922432e.asciidoc new file mode 100644 index 000000000..f80f1ac99 --- /dev/null +++ b/docs/doc_examples/c3b77e11b16e37e9e37e28dec922432e.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.esql.query({ + query: + '\nFROM library\n| WHERE match(author, "Frank Herbert", {"minimum_should_match": 2, "operator": "AND"})\n| LIMIT 5\n', +}); +console.log(response); +---- diff --git a/docs/doc_examples/d2e7dead222cfbebbd2c21a7cc1893b4.asciidoc b/docs/doc_examples/d2e7dead222cfbebbd2c21a7cc1893b4.asciidoc new file mode 100644 index 000000000..ff0c652e4 --- /dev/null +++ b/docs/doc_examples/d2e7dead222cfbebbd2c21a7cc1893b4.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.cluster.state({ + metric: "metadata", + filter_path: "metadata.indices.*.system", +}); +console.log(response); +---- diff --git a/docs/doc_examples/d3a0f648d0fd50b54a4e9ebe363c5047.asciidoc b/docs/doc_examples/d3a0f648d0fd50b54a4e9ebe363c5047.asciidoc new file mode 100644 index 000000000..46940cf06 --- /dev/null +++ b/docs/doc_examples/d3a0f648d0fd50b54a4e9ebe363c5047.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: { + linear: { + retrievers: [ + { + retriever: { + standard: { + query: { + query_string: { + query: "(information retrieval) OR (artificial intelligence)", + default_field: "text", + }, + }, + }, + }, + weight: 2, + normalizer: "minmax", + }, + { + retriever: { + knn: { + field: "vector", + query_vector: [0.23, 0.67, 0.89], + k: 3, + num_candidates: 5, + }, + }, + weight: 1.5, + normalizer: "minmax", + }, + ], + rank_window_size: 10, + }, + }, + _source: false, +}); +console.log(response); +---- diff --git a/docs/doc_examples/d6a4548b29e939fb197189c20c7c016f.asciidoc b/docs/doc_examples/d6a4548b29e939fb197189c20c7c016f.asciidoc new file mode 100644 index 000000000..745cb7efe --- /dev/null +++ b/docs/doc_examples/d6a4548b29e939fb197189c20c7c016f.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: "chat_completion", + inference_id: "chat-completion-endpoint", + inference_config: { + service: "elastic", + service_settings: { + model_id: "model-1", + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/dd16c9c981551c9da47ebb5ef5105fa0.asciidoc b/docs/doc_examples/dd16c9c981551c9da47ebb5ef5105fa0.asciidoc new file mode 100644 index 000000000..c00660b74 --- /dev/null +++ b/docs/doc_examples/dd16c9c981551c9da47ebb5ef5105fa0.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.indices.updateAliases({ + actions: [ + { + add: { + index: ".reindexed-v9-ml-anomalies-custom-example", + alias: ".ml-anomalies-example1", + filter: { + term: { + job_id: { + value: "example1", + }, + }, + }, + is_hidden: true, + }, + }, + { + add: { + index: ".reindexed-v9-ml-anomalies-custom-example", + alias: ".ml-anomalies-example2", + filter: { + term: { + job_id: { + value: "example2", + }, + }, + }, + is_hidden: true, + }, + }, + { + remove: { + index: ".ml-anomalies-custom-example", + aliases: ".ml-anomalies-*", + }, + }, + { + remove_index: { + index: ".ml-anomalies-custom-example", + }, + }, + { + add: { + index: ".reindexed-v9-ml-anomalies-custom-example", + alias: ".ml-anomalies-custom-example", + is_hidden: true, + }, + }, + ], +}); +console.log(response); +---- diff --git a/docs/doc_examples/8b144b3eb20872595fd7cbc6c245c7c8.asciidoc b/docs/doc_examples/e715fb8c792bf09ac98f0ceca99beb84.asciidoc similarity index 67% rename from docs/doc_examples/8b144b3eb20872595fd7cbc6c245c7c8.asciidoc rename to docs/doc_examples/e715fb8c792bf09ac98f0ceca99beb84.asciidoc index 3bccba38f..1b37d265b 100644 --- a/docs/doc_examples/8b144b3eb20872595fd7cbc6c245c7c8.asciidoc +++ b/docs/doc_examples/e715fb8c792bf09ac98f0ceca99beb84.asciidoc @@ -3,8 +3,8 @@ [source, js] ---- -const response = await client.security.queryRole({ - sort: ["name"], +const response = await client.migration.deprecations({ + index: ".ml-anomalies-*", }); console.log(response); ---- diff --git a/docs/doc_examples/9ad0864bcd665b63551e944653d32423.asciidoc b/docs/doc_examples/f994498dd6576be657dedce2822d2b9e.asciidoc similarity index 87% rename from docs/doc_examples/9ad0864bcd665b63551e944653d32423.asciidoc rename to docs/doc_examples/f994498dd6576be657dedce2822d2b9e.asciidoc index f553c8706..21a737450 100644 --- a/docs/doc_examples/9ad0864bcd665b63551e944653d32423.asciidoc +++ b/docs/doc_examples/f994498dd6576be657dedce2822d2b9e.asciidoc @@ -30,6 +30,13 @@ const response = await client.search({ ], }, }, + highlight: { + fields: { + semantic_text: { + number_of_fragments: 2, + }, + }, + }, }); console.log(response); ---- diff --git a/docs/doc_examples/681d24c2633f598fc43d6afff8996dbb.asciidoc b/docs/doc_examples/ffda10edaa7ce087703193c3cb95a426.asciidoc similarity index 92% rename from docs/doc_examples/681d24c2633f598fc43d6afff8996dbb.asciidoc rename to docs/doc_examples/ffda10edaa7ce087703193c3cb95a426.asciidoc index bfb21cf32..0ccb2c77a 100644 --- a/docs/doc_examples/681d24c2633f598fc43d6afff8996dbb.asciidoc +++ b/docs/doc_examples/ffda10edaa7ce087703193c3cb95a426.asciidoc @@ -28,6 +28,9 @@ const response = await client.indices.create({ topic: { type: "keyword", }, + timestamp: { + type: "date", + }, }, }, }); @@ -41,6 +44,7 @@ const response1 = await client.index({ 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"], + timestamp: "2021-01-01T12:10:30", }, }); console.log(response1); @@ -53,6 +57,7 @@ const response2 = await client.index({ 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"], + timestamp: "2022-01-01T12:10:30", }, }); console.log(response2); @@ -65,6 +70,7 @@ const response3 = await client.index({ 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"], + timestamp: "2023-01-01T12:10:30", }, }); console.log(response3); @@ -77,6 +83,7 @@ const response4 = await client.index({ 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"], + timestamp: "2024-01-01T12:10:30", }, }); console.log(response4); @@ -89,6 +96,7 @@ const response5 = await client.index({ 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"], + timestamp: "2025-01-01T12:10:30", }, }); console.log(response5); diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index 5839e93fa..434cbd269 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -201,8 +201,8 @@ client.closePointInTime({ id }) Count search results. Get the number of documents matching a query. -The query can either be provided using a simple query string as a parameter or using the Query DSL defined within the request body. -The latter must be nested in a `query` key, which is the same as the search API. +The query can be provided either by using a simple query string as a parameter, or by defining Query DSL within the request body. +The query is optional. When no query is provided, the API uses `match_all` to count all the documents. The count API supports multi-target syntax. You can run a single count API search across multiple data streams and indices. @@ -220,7 +220,7 @@ client.count({ ... }) * *Request (object):* ** *`index` (Optional, string | string[])*: A list of data streams, indices, and aliases to search. It supports wildcards (`*`). To search all data streams and indices, omit this parameter or use `*` or `_all`. -** *`query` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Defines the search definition using the Query DSL. The query is optional, and when not provided, it will use `match_all` to count all the docs. +** *`query` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Defines the search query using Query DSL. A request body query cannot be used with the `q` query string parameter. ** *`allow_no_indices` (Optional, boolean)*: If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. ** *`analyzer` (Optional, string)*: The analyzer to use for the query string. This parameter can be used only when the `q` query string parameter is specified. ** *`analyze_wildcard` (Optional, boolean)*: If `true`, wildcard and prefix queries are analyzed. This parameter can be used only when the `q` query string parameter is specified. @@ -234,7 +234,7 @@ client.count({ ... }) ** *`preference` (Optional, string)*: The node or shard the operation should be performed on. By default, it is random. ** *`routing` (Optional, string)*: A custom value used to route operations to a specific shard. ** *`terminate_after` (Optional, number)*: The maximum number of documents to collect for each shard. If a query reaches this limit, Elasticsearch terminates the query early. Elasticsearch collects documents before sorting. IMPORTANT: Use with caution. Elasticsearch applies this parameter to each shard handling the request. When possible, let Elasticsearch perform early termination automatically. Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers. -** *`q` (Optional, string)*: The query in Lucene query string syntax. +** *`q` (Optional, string)*: The query in Lucene query string syntax. This parameter cannot be used with a request body. [discrete] === create @@ -542,7 +542,7 @@ client.deleteByQueryRethrottle({ task_id }) Delete a script or search template. Deletes a stored script or search template. -{ref}/modules-scripting.html[Endpoint documentation] +{ref}/delete-stored-script-api.html[Endpoint documentation] [source,ts] ---- client.deleteScript({ id }) @@ -551,9 +551,9 @@ client.deleteScript({ id }) ==== Arguments * *Request (object):* -** *`id` (string)*: Identifier for the stored script or search template. -** *`master_timeout` (Optional, string | -1 | 0)*: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. -** *`timeout` (Optional, string | -1 | 0)*: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. +** *`id` (string)*: The identifier for the stored script or search template. +** *`master_timeout` (Optional, string | -1 | 0)*: The period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. It can also be set to `-1` to indicate that the request should never timeout. +** *`timeout` (Optional, string | -1 | 0)*: The period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. It can also be set to `-1` to indicate that the request should never timeout. [discrete] === exists @@ -636,7 +636,8 @@ client.existsSource({ id, index }) [discrete] === explain Explain a document match result. -Returns information about why a specific document matches, or doesn’t match, a query. +Get information about why a specific document matches, or doesn't match, a query. +It computes a score explanation for a query and a specific document. {ref}/search-explain.html[Endpoint documentation] [source,ts] @@ -647,21 +648,21 @@ client.explain({ id, index }) ==== Arguments * *Request (object):* -** *`id` (string)*: Defines the document ID. -** *`index` (string)*: Index names used to limit the request. Only a single index name can be provided to this parameter. +** *`id` (string)*: The document identifier. +** *`index` (string)*: Index names that are used to limit the request. Only a single index name can be provided to this parameter. ** *`query` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Defines the search definition using the Query DSL. -** *`analyzer` (Optional, string)*: Analyzer to use for the query string. This parameter can only be used when the `q` query string parameter is specified. -** *`analyze_wildcard` (Optional, boolean)*: If `true`, wildcard and prefix queries are analyzed. -** *`default_operator` (Optional, Enum("and" | "or"))*: The default operator for query string query: `AND` or `OR`. -** *`df` (Optional, string)*: Field to use as default where no field prefix is given in the query string. -** *`lenient` (Optional, boolean)*: If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. -** *`preference` (Optional, string)*: Specifies the node or shard the operation should be performed on. Random by default. -** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. -** *`_source` (Optional, boolean | string | string[])*: True or false to return the `_source` field or not, or a list of fields to return. -** *`_source_excludes` (Optional, string | string[])*: A list of source fields to exclude from the response. -** *`_source_includes` (Optional, string | string[])*: A list of source fields to include in the response. +** *`analyzer` (Optional, string)*: The analyzer to use for the query string. This parameter can be used only when the `q` query string parameter is specified. +** *`analyze_wildcard` (Optional, boolean)*: If `true`, wildcard and prefix queries are analyzed. This parameter can be used only when the `q` query string parameter is specified. +** *`default_operator` (Optional, Enum("and" | "or"))*: The default operator for query string query: `AND` or `OR`. This parameter can be used only when the `q` query string parameter is specified. +** *`df` (Optional, string)*: The field to use as default where no field prefix is given in the query string. This parameter can be used only when the `q` query string parameter is specified. +** *`lenient` (Optional, boolean)*: If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. This parameter can be used only when the `q` query string parameter is specified. +** *`preference` (Optional, string)*: The node or shard the operation should be performed on. It is random by default. +** *`routing` (Optional, string)*: A custom value used to route operations to a specific shard. +** *`_source` (Optional, boolean | string | string[])*: `True` or `false` to return the `_source` field or not or a list of fields to return. +** *`_source_excludes` (Optional, string | string[])*: A list of source fields to exclude from the response. You can also use this parameter to exclude fields from the subset specified in `_source_includes` query parameter. If the `_source` parameter is `false`, this parameter is ignored. +** *`_source_includes` (Optional, string | string[])*: A list of source fields to include in the response. If this parameter is specified, only these source fields are returned. You can exclude fields from this subset using the `_source_excludes` query parameter. If the `_source` parameter is `false`, this parameter is ignored. ** *`stored_fields` (Optional, string | string[])*: A list of stored fields to return in the response. -** *`q` (Optional, string)*: Query in the Lucene query string syntax. +** *`q` (Optional, string)*: The query in the Lucene query string syntax. [discrete] === field_caps @@ -682,16 +683,16 @@ client.fieldCaps({ ... }) ==== Arguments * *Request (object):* -** *`index` (Optional, string | string[])*: List of data streams, indices, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indices, omit this parameter or use * or _all. -** *`fields` (Optional, string | string[])*: List of fields to retrieve capabilities for. Wildcard (`*`) expressions are supported. -** *`index_filter` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Allows to filter indices if the provided query rewrites to match_none on every shard. -** *`runtime_mappings` (Optional, Record)*: Defines ad-hoc runtime fields in the request similar to the way it is done in search requests. These fields exist only as part of the query and take precedence over fields defined with the same name in the index mappings. +** *`index` (Optional, string | string[])*: A list of data streams, indices, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indices, omit this parameter or use * or _all. +** *`fields` (Optional, string | string[])*: A list of fields to retrieve capabilities for. Wildcard (`*`) expressions are supported. +** *`index_filter` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Filter indices if the provided query rewrites to `match_none` on every shard. IMPORTANT: The filtering is done on a best-effort basis, it uses index statistics and mappings to rewrite queries to `match_none` instead of fully running the request. For instance a range query over a date field can rewrite to `match_none` if all documents within a shard (including deleted documents) are outside of the provided range. However, not all queries can rewrite to `match_none` so this API may return an index even if the provided filter matches no document. +** *`runtime_mappings` (Optional, Record)*: Define ad-hoc runtime fields in the request similar to the way it is done in search requests. These fields exist only as part of the query and take precedence over fields defined with the same name in the index mappings. ** *`allow_no_indices` (Optional, boolean)*: If false, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting `foo*,bar*` returns an error if an index starts with foo but no index starts with bar. -** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports a list of values, such as `open,hidden`. +** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: The type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports a list of values, such as `open,hidden`. ** *`ignore_unavailable` (Optional, boolean)*: If `true`, missing or closed indices are not included in the response. ** *`include_unmapped` (Optional, boolean)*: If true, unmapped fields are included in the response. -** *`filters` (Optional, string)*: An optional set of filters: can include +metadata,-metadata,-nested,-multifield,-parent -** *`types` (Optional, string[])*: Only return results for fields that have one of the types in the list +** *`filters` (Optional, string)*: A list of filters to apply to the response. +** *`types` (Optional, string[])*: A list of field types to include. Any fields that do not match one of these types will be excluded from the results. It defaults to empty, meaning that all field types are returned. ** *`include_empty_fields` (Optional, boolean)*: If false, empty fields are not included in the response. [discrete] @@ -792,8 +793,8 @@ client.getScript({ id }) ==== Arguments * *Request (object):* -** *`id` (string)*: Identifier for the stored script or search template. -** *`master_timeout` (Optional, string | -1 | 0)*: Specify timeout for connection to master +** *`id` (string)*: The identifier for the stored script or search template. +** *`master_timeout` (Optional, string | -1 | 0)*: The period to wait for the master node. If the master node is not available before the timeout expires, the request fails and returns an error. It can also be set to `-1` to indicate that the request should never timeout. [discrete] === get_script_context @@ -801,7 +802,7 @@ Get script contexts. Get a list of supported script contexts and their methods. -{painless}/painless-contexts.html[Endpoint documentation] +{ref}/get-script-contexts-api.html[Endpoint documentation] [source,ts] ---- client.getScriptContext() @@ -813,7 +814,7 @@ Get script languages. Get a list of available script types, languages, and contexts. -{ref}/modules-scripting.html[Endpoint documentation] +{ref}/get-script-languages-api.html[Endpoint documentation] [source,ts] ---- client.getScriptLanguages() @@ -1067,7 +1068,13 @@ This means the results returned are not always the true k closest neighbors. The kNN search API supports restricting the search using a filter. The search will return the top k documents that also match the filter query. -{ref}/search-search.html[Endpoint documentation] +A kNN search response has the exact same structure as a search API response. +However, certain sections have a meaning specific to kNN search: + +* The document `_score` is determined by the similarity between the query and document vector. +* The `hits.total` object contains the total number of nearest neighbor candidates considered, which is `num_candidates * num_shards`. The `hits.total.relation` will always be `eq`, indicating an exact value. + +{ref}/knn-search-api.html[Endpoint documentation] [source,ts] ---- client.knnSearch({ index, knn }) @@ -1076,14 +1083,14 @@ client.knnSearch({ index, knn }) ==== Arguments * *Request (object):* -** *`index` (string | string[])*: A list of index names to search; use `_all` or to perform the operation on all indices -** *`knn` ({ field, query_vector, k, num_candidates })*: kNN query to execute -** *`_source` (Optional, boolean | { excludes, includes })*: Indicates which source fields are returned for matching documents. These fields are returned in the hits._source property of the search response. -** *`docvalue_fields` (Optional, { field, format, include_unmapped }[])*: The request returns doc values for field names matching these patterns in the hits.fields property of the response. Accepts wildcard (*) patterns. -** *`stored_fields` (Optional, string | string[])*: List of stored fields to return as part of a hit. If no fields are specified, no stored fields are included in the response. If this field is specified, the _source parameter defaults to false. You can pass _source: true to return both source fields and stored fields in the search response. -** *`fields` (Optional, string | string[])*: The request returns values for field names matching these patterns in the hits.fields property of the response. Accepts wildcard (*) patterns. -** *`filter` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type } | { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type }[])*: Query to filter the documents that can match. The kNN search will return the top `k` documents that also match this filter. The value can be a single query or a list of queries. If `filter` isn't provided, all documents are allowed to match. -** *`routing` (Optional, string)*: A list of specific routing values +** *`index` (string | string[])*: A list of index names to search; use `_all` or to perform the operation on all indices. +** *`knn` ({ field, query_vector, k, num_candidates })*: The kNN query to run. +** *`_source` (Optional, boolean | { excludes, includes })*: Indicates which source fields are returned for matching documents. These fields are returned in the `hits._source` property of the search response. +** *`docvalue_fields` (Optional, { field, format, include_unmapped }[])*: The request returns doc values for field names matching these patterns in the `hits.fields` property of the response. It accepts wildcard (`*`) patterns. +** *`stored_fields` (Optional, string | string[])*: A list of stored fields to return as part of a hit. If no fields are specified, no stored fields are included in the response. If this field is specified, the `_source` parameter defaults to `false`. You can pass `_source: true` to return both source fields and stored fields in the search response. +** *`fields` (Optional, string | string[])*: The request returns values for field names matching these patterns in the `hits.fields` property of the response. It accepts wildcard (`*`) patterns. +** *`filter` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type } | { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type }[])*: A query to filter the documents that can match. The kNN search will return the top `k` documents that also match this filter. The value can be a single query or a list of queries. If `filter` isn't provided, all documents are allowed to match. +** *`routing` (Optional, string)*: A list of specific routing values. [discrete] === mget @@ -1093,6 +1100,18 @@ Get multiple JSON documents by ID from one or more indices. If you specify an index in the request URI, you only need to specify the document IDs in the request body. To ensure fast responses, this multi get (mget) API responds with partial results if one or more shards fail. +**Filter source fields** + +By default, the `_source` field is returned for every document (if stored). +Use the `_source` and `_source_include` or `source_exclude` attributes to filter what fields are returned for a particular document. +You can include the `_source`, `_source_includes`, and `_source_excludes` query parameters in the request URI to specify the defaults to use when there are no per-document instructions. + +**Get stored fields** + +Use the `stored_fields` attribute to specify the set of stored fields you want to retrieve. +Any requested fields that are not stored are ignored. +You can include the `stored_fields` query parameter in the request URI to specify the defaults to use when there are no per-document instructions. + {ref}/docs-multi-get.html[Endpoint documentation] [source,ts] ---- @@ -1164,7 +1183,21 @@ client.msearch({ ... }) === msearch_template Run multiple templated searches. -{ref}/search-multi-search.html[Endpoint documentation] +Run multiple templated searches with a single request. +If you are providing a text file or text input to `curl`, use the `--data-binary` flag instead of `-d` to preserve newlines. +For example: + +---- +$ cat requests +{ "index": "my-index" } +{ "id": "my-search-template", "params": { "query_string": "hello world", "from": 0, "size": 10 }} +{ "index": "my-other-index" } +{ "id": "my-other-search-template", "params": { "query_type": "match_all" }} + +$ curl -H "Content-Type: application/x-ndjson" -XGET localhost:9200/_msearch/template --data-binary "@requests"; echo +---- + +{ref}/multi-search-template.html[Endpoint documentation] [source,ts] ---- client.msearchTemplate({ ... }) @@ -1173,11 +1206,11 @@ client.msearchTemplate({ ... }) ==== Arguments * *Request (object):* -** *`index` (Optional, string | string[])*: List of data streams, indices, and aliases to search. Supports wildcards (`*`). To search all data streams and indices, omit this parameter or use `*`. +** *`index` (Optional, string | string[])*: A list of data streams, indices, and aliases to search. It supports wildcards (`*`). To search all data streams and indices, omit this parameter or use `*`. ** *`search_templates` (Optional, { allow_no_indices, expand_wildcards, ignore_unavailable, index, preference, request_cache, routing, search_type, ccs_minimize_roundtrips, allow_partial_search_results, ignore_throttled } | { aggregations, collapse, query, explain, ext, stored_fields, docvalue_fields, knn, from, highlight, indices_boost, min_score, post_filter, profile, rescore, script_fields, search_after, size, sort, _source, fields, terminate_after, stats, timeout, track_scores, track_total_hits, version, runtime_mappings, seq_no_primary_term, pit, suggest }[])* ** *`ccs_minimize_roundtrips` (Optional, boolean)*: If `true`, network round-trips are minimized for cross-cluster search requests. -** *`max_concurrent_searches` (Optional, number)*: Maximum number of concurrent searches the API can run. -** *`search_type` (Optional, Enum("query_then_fetch" | "dfs_query_then_fetch"))*: The type of the search operation. Available options: `query_then_fetch`, `dfs_query_then_fetch`. +** *`max_concurrent_searches` (Optional, number)*: The maximum number of concurrent searches the API can run. +** *`search_type` (Optional, Enum("query_then_fetch" | "dfs_query_then_fetch"))*: The type of the search operation. ** *`rest_total_hits_as_int` (Optional, boolean)*: If `true`, the response returns `hits.total` as an integer. If `false`, it returns `hits.total` as an object. ** *`typed_keys` (Optional, boolean)*: If `true`, the response prefixes aggregation and suggester names with their respective types. @@ -1185,11 +1218,17 @@ client.msearchTemplate({ ... }) === mtermvectors Get multiple term vectors. +Get multiple term vectors with a single request. You can specify existing documents by index and ID or provide artificial documents in the body of the request. You can specify the index in the request body or request URI. The response contains a `docs` array with all the fetched termvectors. Each element has the structure provided by the termvectors API. +**Artificial documents** + +You can also use `mtermvectors` to generate term vectors for artificial documents provided in the body of the request. +The mapping used is determined by the specified `_index`. + {ref}/docs-multi-termvectors.html[Endpoint documentation] [source,ts] ---- @@ -1199,20 +1238,20 @@ client.mtermvectors({ ... }) ==== Arguments * *Request (object):* -** *`index` (Optional, string)*: Name of the index that contains the documents. -** *`docs` (Optional, { _id, _index, routing, _source, stored_fields, version, version_type }[])*: Array of existing or artificial documents. -** *`ids` (Optional, string[])*: Simplified syntax to specify documents by their ID if they're in the same index. -** *`fields` (Optional, string | string[])*: List or wildcard expressions of fields to include in the statistics. Used as the default list unless a specific field list is provided in the `completion_fields` or `fielddata_fields` parameters. +** *`index` (Optional, string)*: The name of the index that contains the documents. +** *`docs` (Optional, { _id, _index, routing, _source, stored_fields, version, version_type }[])*: An array of existing or artificial documents. +** *`ids` (Optional, string[])*: A simplified syntax to specify documents by their ID if they're in the same index. +** *`fields` (Optional, string | string[])*: A list or wildcard expressions of fields to include in the statistics. It is used as the default list unless a specific field list is provided in the `completion_fields` or `fielddata_fields` parameters. ** *`field_statistics` (Optional, boolean)*: If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies. ** *`offsets` (Optional, boolean)*: If `true`, the response includes term offsets. ** *`payloads` (Optional, boolean)*: If `true`, the response includes term payloads. ** *`positions` (Optional, boolean)*: If `true`, the response includes term positions. -** *`preference` (Optional, string)*: Specifies the node or shard the operation should be performed on. Random by default. +** *`preference` (Optional, string)*: The node or shard the operation should be performed on. It is random by default. ** *`realtime` (Optional, boolean)*: If true, the request is real-time as opposed to near-real-time. -** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. +** *`routing` (Optional, string)*: A custom value used to route operations to a specific shard. ** *`term_statistics` (Optional, boolean)*: If true, the response includes term frequency and document frequency. ** *`version` (Optional, number)*: If `true`, returns the document version as part of a hit. -** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type. +** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: The version type. [discrete] === open_point_in_time @@ -1288,7 +1327,7 @@ client.ping() Create or update a script or search template. Creates or updates a stored script or search template. -{ref}/modules-scripting.html[Endpoint documentation] +{ref}/create-stored-script-api.html[Endpoint documentation] [source,ts] ---- client.putScript({ id, script }) @@ -1297,11 +1336,11 @@ client.putScript({ id, script }) ==== Arguments * *Request (object):* -** *`id` (string)*: Identifier for the stored script or search template. Must be unique within the cluster. -** *`script` ({ lang, options, source })*: Contains the script or search template, its parameters, and its language. -** *`context` (Optional, string)*: Context in which the script or search template should run. To prevent errors, the API immediately compiles the script or template in this context. -** *`master_timeout` (Optional, string | -1 | 0)*: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. -** *`timeout` (Optional, string | -1 | 0)*: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. +** *`id` (string)*: The identifier for the stored script or search template. It must be unique within the cluster. +** *`script` ({ lang, options, source })*: The script or search template, its parameters, and its language. +** *`context` (Optional, string)*: The context in which the script or search template should run. To prevent errors, the API immediately compiles the script or template in this context. +** *`master_timeout` (Optional, string | -1 | 0)*: The period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. It can also be set to `-1` to indicate that the request should never timeout. +** *`timeout` (Optional, string | -1 | 0)*: The period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. It can also be set to `-1` to indicate that the request should never timeout. [discrete] === rank_eval @@ -1319,7 +1358,7 @@ client.rankEval({ requests }) * *Request (object):* ** *`requests` ({ id, request, ratings, template_id, params }[])*: A set of typical search requests, together with their provided ratings. -** *`index` (Optional, string | string[])*: List of data streams, indices, and index aliases used to limit the request. Wildcard (`*`) expressions are supported. To target all data streams and indices in a cluster, omit this parameter or use `_all` or `*`. +** *`index` (Optional, string | string[])*: A list of data streams, indices, and index aliases used to limit the request. Wildcard (`*`) expressions are supported. To target all data streams and indices in a cluster, omit this parameter or use `_all` or `*`. ** *`metric` (Optional, { precision, recall, mean_reciprocal_rank, dcg, expected_reciprocal_rank })*: Definition of the evaluation metric to calculate. ** *`allow_no_indices` (Optional, boolean)*: If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. ** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Whether to expand wildcard expression to concrete indices that are open, closed or both. @@ -1577,10 +1616,10 @@ client.renderSearchTemplate({ ... }) ==== Arguments * *Request (object):* -** *`id` (Optional, string)*: ID of the search template to render. If no `source` is specified, this or the `id` request body parameter is required. +** *`id` (Optional, string)*: The ID of the search template to render. If no `source` is specified, this or the `id` request body parameter is required. ** *`file` (Optional, string)* ** *`params` (Optional, Record)*: Key-value pairs used to replace Mustache variables in the template. The key is the variable name. The value is the variable value. -** *`source` (Optional, string)*: An inline search template. Supports the same parameters as the search API's request body. These parameters also support Mustache variables. If no `id` or `` is specified, this parameter is required. +** *`source` (Optional, string)*: An inline search template. It supports the same parameters as the search API's request body. These parameters also support Mustache variables. If no `id` or `` is specified, this parameter is required. [discrete] === scripts_painless_execute @@ -1617,7 +1656,7 @@ You can also use the scroll API to specify a new scroll parameter that extends o IMPORTANT: Results from a scrolling search reflect the state of the index at the time of the initial search request. Subsequent indexing or document changes only affect later search and scroll requests. -{ref}/search-request-body.html[Endpoint documentation] +{ref}/scroll-api.html[Endpoint documentation] [source,ts] ---- client.scroll({ scroll_id }) @@ -1626,8 +1665,8 @@ client.scroll({ scroll_id }) ==== Arguments * *Request (object):* -** *`scroll_id` (string)*: Scroll ID of the search. -** *`scroll` (Optional, string | -1 | 0)*: Period to retain the search context for scrolling. +** *`scroll_id` (string)*: The scroll ID of the search. +** *`scroll` (Optional, string | -1 | 0)*: The period to retain the search context for scrolling. ** *`rest_total_hits_as_int` (Optional, boolean)*: If true, the API response’s hit.total property is returned as an integer. If false, the API response’s hit.total property is returned as an object. [discrete] @@ -1734,6 +1773,138 @@ client.search({ ... }) Search a vector tile. Search a vector tile for geospatial values. +Before using this API, you should be familiar with the Mapbox vector tile specification. +The API returns results as a binary mapbox vector tile. + +Internally, Elasticsearch translates a vector tile search API request into a search containing: + +* A `geo_bounding_box` query on the ``. The query uses the `//` tile as a bounding box. +* A `geotile_grid` or `geohex_grid` aggregation on the ``. The `grid_agg` parameter determines the aggregation type. The aggregation uses the `//` tile as a bounding box. +* Optionally, a `geo_bounds` aggregation on the ``. The search only includes this aggregation if the `exact_bounds` parameter is `true`. +* If the optional parameter `with_labels` is `true`, the internal search will include a dynamic runtime field that calls the `getLabelPosition` function of the geometry doc value. This enables the generation of new point features containing suggested geometry labels, so that, for example, multi-polygons will have only one label. + +For example, Elasticsearch may translate a vector tile search API request with a `grid_agg` argument of `geotile` and an `exact_bounds` argument of `true` into the following search + +---- +GET my-index/_search +{ + "size": 10000, + "query": { + "geo_bounding_box": { + "my-geo-field": { + "top_left": { + "lat": -40.979898069620134, + "lon": -45 + }, + "bottom_right": { + "lat": -66.51326044311186, + "lon": 0 + } + } + } + }, + "aggregations": { + "grid": { + "geotile_grid": { + "field": "my-geo-field", + "precision": 11, + "size": 65536, + "bounds": { + "top_left": { + "lat": -40.979898069620134, + "lon": -45 + }, + "bottom_right": { + "lat": -66.51326044311186, + "lon": 0 + } + } + } + }, + "bounds": { + "geo_bounds": { + "field": "my-geo-field", + "wrap_longitude": false + } + } + } +} +---- + +The API returns results as a binary Mapbox vector tile. +Mapbox vector tiles are encoded as Google Protobufs (PBF). By default, the tile contains three layers: + +* A `hits` layer containing a feature for each `` value matching the `geo_bounding_box` query. +* An `aggs` layer containing a feature for each cell of the `geotile_grid` or `geohex_grid`. The layer only contains features for cells with matching data. +* A meta layer containing: + * A feature containing a bounding box. By default, this is the bounding box of the tile. + * Value ranges for any sub-aggregations on the `geotile_grid` or `geohex_grid`. + * Metadata for the search. + +The API only returns features that can display at its zoom level. +For example, if a polygon feature has no area at its zoom level, the API omits it. +The API returns errors as UTF-8 encoded JSON. + +IMPORTANT: You can specify several options for this API as either a query parameter or request body parameter. +If you specify both parameters, the query parameter takes precedence. + +**Grid precision for geotile** + +For a `grid_agg` of `geotile`, you can use cells in the `aggs` layer as tiles for lower zoom levels. +`grid_precision` represents the additional zoom levels available through these cells. The final precision is computed by as follows: ` + grid_precision`. +For example, if `` is 7 and `grid_precision` is 8, then the `geotile_grid` aggregation will use a precision of 15. +The maximum final precision is 29. +The `grid_precision` also determines the number of cells for the grid as follows: `(2^grid_precision) x (2^grid_precision)`. +For example, a value of 8 divides the tile into a grid of 256 x 256 cells. +The `aggs` layer only contains features for cells with matching data. + +**Grid precision for geohex** + +For a `grid_agg` of `geohex`, Elasticsearch uses `` and `grid_precision` to calculate a final precision as follows: ` + grid_precision`. + +This precision determines the H3 resolution of the hexagonal cells produced by the `geohex` aggregation. +The following table maps the H3 resolution for each precision. +For example, if `` is 3 and `grid_precision` is 3, the precision is 6. +At a precision of 6, hexagonal cells have an H3 resolution of 2. +If `` is 3 and `grid_precision` is 4, the precision is 7. +At a precision of 7, hexagonal cells have an H3 resolution of 3. + +| Precision | Unique tile bins | H3 resolution | Unique hex bins | Ratio | +| --------- | ---------------- | ------------- | ----------------| ----- | +| 1 | 4 | 0 | 122 | 30.5 | +| 2 | 16 | 0 | 122 | 7.625 | +| 3 | 64 | 1 | 842 | 13.15625 | +| 4 | 256 | 1 | 842 | 3.2890625 | +| 5 | 1024 | 2 | 5882 | 5.744140625 | +| 6 | 4096 | 2 | 5882 | 1.436035156 | +| 7 | 16384 | 3 | 41162 | 2.512329102 | +| 8 | 65536 | 3 | 41162 | 0.6280822754 | +| 9 | 262144 | 4 | 288122 | 1.099098206 | +| 10 | 1048576 | 4 | 288122 | 0.2747745514 | +| 11 | 4194304 | 5 | 2016842 | 0.4808526039 | +| 12 | 16777216 | 6 | 14117882 | 0.8414913416 | +| 13 | 67108864 | 6 | 14117882 | 0.2103728354 | +| 14 | 268435456 | 7 | 98825162 | 0.3681524172 | +| 15 | 1073741824 | 8 | 691776122 | 0.644266719 | +| 16 | 4294967296 | 8 | 691776122 | 0.1610666797 | +| 17 | 17179869184 | 9 | 4842432842 | 0.2818666889 | +| 18 | 68719476736 | 10 | 33897029882 | 0.4932667053 | +| 19 | 274877906944 | 11 | 237279209162 | 0.8632167343 | +| 20 | 1099511627776 | 11 | 237279209162 | 0.2158041836 | +| 21 | 4398046511104 | 12 | 1660954464122 | 0.3776573213 | +| 22 | 17592186044416 | 13 | 11626681248842 | 0.6609003122 | +| 23 | 70368744177664 | 13 | 11626681248842 | 0.165225078 | +| 24 | 281474976710656 | 14 | 81386768741882 | 0.2891438866 | +| 25 | 1125899906842620 | 15 | 569707381193162 | 0.5060018015 | +| 26 | 4503599627370500 | 15 | 569707381193162 | 0.1265004504 | +| 27 | 18014398509482000 | 15 | 569707381193162 | 0.03162511259 | +| 28 | 72057594037927900 | 15 | 569707381193162 | 0.007906278149 | +| 29 | 288230376151712000 | 15 | 569707381193162 | 0.001976569537 | + +Hexagonal cells don't align perfectly on a vector tile. +Some cells may intersect more than one vector tile. +To compute the H3 resolution for each precision, Elasticsearch compares the average density of hexagonal bins at each resolution with the average density of tile bins at each zoom level. +Elasticsearch uses the H3 resolution that is closest to the corresponding geotile density. {ref}/search-vector-tile-api.html[Endpoint documentation] [source,ts] @@ -1749,20 +1920,20 @@ client.searchMvt({ index, field, zoom, x, y }) ** *`zoom` (number)*: Zoom level for the vector tile to search ** *`x` (number)*: X coordinate for the vector tile to search ** *`y` (number)*: Y coordinate for the vector tile to search -** *`aggs` (Optional, Record)*: Sub-aggregations for the geotile_grid. Supports the following aggregation types: - avg - cardinality - max - min - sum -** *`buffer` (Optional, number)*: Size, in pixels, of a clipping buffer outside the tile. This allows renderers to avoid outline artifacts from geometries that extend past the extent of the tile. -** *`exact_bounds` (Optional, boolean)*: If false, the meta layer’s feature is the bounding box of the tile. If true, the meta layer’s feature is a bounding box resulting from a geo_bounds aggregation. The aggregation runs on values that intersect the // tile with wrap_longitude set to false. The resulting bounding box may be larger than the vector tile. -** *`extent` (Optional, number)*: Size, in pixels, of a side of the tile. Vector tiles are square with equal sides. -** *`fields` (Optional, string | string[])*: Fields to return in the `hits` layer. Supports wildcards (`*`). This parameter does not support fields with array values. Fields with array values may return inconsistent results. -** *`grid_agg` (Optional, Enum("geotile" | "geohex"))*: Aggregation used to create a grid for the `field`. -** *`grid_precision` (Optional, number)*: Additional zoom levels available through the aggs layer. For example, if is 7 and grid_precision is 8, you can zoom in up to level 15. Accepts 0-8. If 0, results don’t include the aggs layer. -** *`grid_type` (Optional, Enum("grid" | "point" | "centroid"))*: Determines the geometry type for features in the aggs layer. In the aggs layer, each feature represents a geotile_grid cell. If 'grid' each feature is a Polygon of the cells bounding box. If 'point' each feature is a Point that is the centroid of the cell. -** *`query` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Query DSL used to filter documents for the search. +** *`aggs` (Optional, Record)*: Sub-aggregations for the geotile_grid. It supports the following aggregation types: - `avg` - `boxplot` - `cardinality` - `extended stats` - `max` - `median absolute deviation` - `min` - `percentile` - `percentile-rank` - `stats` - `sum` - `value count` The aggregation names can't start with `_mvt_`. The `_mvt_` prefix is reserved for internal aggregations. +** *`buffer` (Optional, number)*: The size, in pixels, of a clipping buffer outside the tile. This allows renderers to avoid outline artifacts from geometries that extend past the extent of the tile. +** *`exact_bounds` (Optional, boolean)*: If `false`, the meta layer's feature is the bounding box of the tile. If `true`, the meta layer's feature is a bounding box resulting from a `geo_bounds` aggregation. The aggregation runs on values that intersect the `//` tile with `wrap_longitude` set to `false`. The resulting bounding box may be larger than the vector tile. +** *`extent` (Optional, number)*: The size, in pixels, of a side of the tile. Vector tiles are square with equal sides. +** *`fields` (Optional, string | string[])*: The fields to return in the `hits` layer. It supports wildcards (`*`). This parameter does not support fields with array values. Fields with array values may return inconsistent results. +** *`grid_agg` (Optional, Enum("geotile" | "geohex"))*: The aggregation used to create a grid for the `field`. +** *`grid_precision` (Optional, number)*: Additional zoom levels available through the aggs layer. For example, if `` is `7` and `grid_precision` is `8`, you can zoom in up to level 15. Accepts 0-8. If 0, results don't include the aggs layer. +** *`grid_type` (Optional, Enum("grid" | "point" | "centroid"))*: Determines the geometry type for features in the aggs layer. In the aggs layer, each feature represents a `geotile_grid` cell. If `grid, each feature is a polygon of the cells bounding box. If `point`, each feature is a Point that is the centroid of the cell. +** *`query` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: The query DSL used to filter documents for the search. ** *`runtime_mappings` (Optional, Record)*: Defines one or more runtime fields in the search request. These fields take precedence over mapped fields with the same name. -** *`size` (Optional, number)*: Maximum number of features to return in the hits layer. Accepts 0-10000. If 0, results don’t include the hits layer. -** *`sort` (Optional, string | { _score, _doc, _geo_distance, _script } | string | { _score, _doc, _geo_distance, _script }[])*: Sorts features in the hits layer. By default, the API calculates a bounding box for each feature. It sorts features based on this box’s diagonal length, from longest to shortest. -** *`track_total_hits` (Optional, boolean | number)*: Number of hits matching the query to count accurately. If `true`, the exact number of hits is returned at the cost of some performance. If `false`, the response does not include the total number of hits matching the query. -** *`with_labels` (Optional, boolean)*: If `true`, the hits and aggs layers will contain additional point features representing suggested label positions for the original features. +** *`size` (Optional, number)*: The maximum number of features to return in the hits layer. Accepts 0-10000. If 0, results don't include the hits layer. +** *`sort` (Optional, string | { _score, _doc, _geo_distance, _script } | string | { _score, _doc, _geo_distance, _script }[])*: Sort the features in the hits layer. By default, the API calculates a bounding box for each feature. It sorts features based on this box's diagonal length, from longest to shortest. +** *`track_total_hits` (Optional, boolean | number)*: The number of hits matching the query to count accurately. If `true`, the exact number of hits is returned at the cost of some performance. If `false`, the response does not include the total number of hits matching the query. +** *`with_labels` (Optional, boolean)*: If `true`, the hits and aggs layers will contain additional point features representing suggested label positions for the original features. * `Point` and `MultiPoint` features will have one of the points selected. * `Polygon` and `MultiPolygon` features will have a single point generated, either the centroid, if it is within the polygon, or another point within the polygon selected from the sorted triangle-tree. * `LineString` features will likewise provide a roughly central point selected from the triangle-tree. * The aggregation results will provide one central point for each aggregation bucket. All attributes from the original features will also be copied to the new label features. In addition, the new features will be distinguishable using the tag `_mvt_label_position`. [discrete] === search_shards @@ -1770,7 +1941,9 @@ Get the search shards. Get the indices and shards that a search request would be run against. This information can be useful for working out issues or planning optimizations with routing and shard preferences. -When filtered aliases are used, the filter is returned as part of the indices section. +When filtered aliases are used, the filter is returned as part of the `indices` section. + +If the Elasticsearch security features are enabled, you must have the `view_index_metadata` or `manage` index privilege for the target data stream, index, or alias. {ref}/search-shards.html[Endpoint documentation] [source,ts] @@ -1781,19 +1954,19 @@ client.searchShards({ ... }) ==== Arguments * *Request (object):* -** *`index` (Optional, string | string[])*: Returns the indices and shards that a search request would be executed against. +** *`index` (Optional, string | string[])*: A list of data streams, indices, and aliases to search. It supports wildcards (`*`). To search all data streams and indices, omit this parameter or use `*` or `_all`. ** *`allow_no_indices` (Optional, boolean)*: If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. ** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports a list of values, such as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. ** *`ignore_unavailable` (Optional, boolean)*: If `false`, the request returns an error if it targets a missing or closed index. ** *`local` (Optional, boolean)*: If `true`, the request retrieves information from the local node only. -** *`preference` (Optional, string)*: Specifies the node or shard the operation should be performed on. Random by default. -** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. +** *`preference` (Optional, string)*: The node or shard the operation should be performed on. It is random by default. +** *`routing` (Optional, string)*: A custom value used to route operations to a specific shard. [discrete] === search_template Run a search with a search template. -{ref}/search-template.html[Endpoint documentation] +{ref}/search-template-api.html[Endpoint documentation] [source,ts] ---- client.searchTemplate({ ... }) @@ -1802,22 +1975,22 @@ client.searchTemplate({ ... }) ==== Arguments * *Request (object):* -** *`index` (Optional, string | string[])*: List of data streams, indices, and aliases to search. Supports wildcards (*). -** *`explain` (Optional, boolean)*: If `true`, returns detailed information about score calculation as part of each hit. -** *`id` (Optional, string)*: ID of the search template to use. If no source is specified, this parameter is required. +** *`index` (Optional, string | string[])*: A list of data streams, indices, and aliases to search. It supports wildcards (`*`). +** *`explain` (Optional, boolean)*: If `true`, returns detailed information about score calculation as part of each hit. If you specify both this and the `explain` query parameter, the API uses only the query parameter. +** *`id` (Optional, string)*: The ID of the search template to use. If no `source` is specified, this parameter is required. ** *`params` (Optional, Record)*: Key-value pairs used to replace Mustache variables in the template. The key is the variable name. The value is the variable value. ** *`profile` (Optional, boolean)*: If `true`, the query execution is profiled. -** *`source` (Optional, string)*: An inline search template. Supports the same parameters as the search API's request body. Also supports Mustache variables. If no id is specified, this parameter is required. +** *`source` (Optional, string)*: An inline search template. Supports the same parameters as the search API's request body. It also supports Mustache variables. If no `id` is specified, this parameter is required. ** *`allow_no_indices` (Optional, boolean)*: If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. ** *`ccs_minimize_roundtrips` (Optional, boolean)*: If `true`, network round-trips are minimized for cross-cluster search requests. -** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports a list of values, such as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. +** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: The type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports a list of values, such as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. ** *`ignore_throttled` (Optional, boolean)*: If `true`, specified concrete, expanded, or aliased indices are not included in the response when throttled. ** *`ignore_unavailable` (Optional, boolean)*: If `false`, the request returns an error if it targets a missing or closed index. -** *`preference` (Optional, string)*: Specifies the node or shard the operation should be performed on. Random by default. -** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. +** *`preference` (Optional, string)*: The node or shard the operation should be performed on. It is random by default. +** *`routing` (Optional, string)*: A custom value used to route operations to a specific shard. ** *`scroll` (Optional, string | -1 | 0)*: Specifies how long a consistent view of the index should be maintained for scrolled search. ** *`search_type` (Optional, Enum("query_then_fetch" | "dfs_query_then_fetch"))*: The type of the search operation. -** *`rest_total_hits_as_int` (Optional, boolean)*: If true, hits.total are rendered as an integer in the response. +** *`rest_total_hits_as_int` (Optional, boolean)*: If `true`, `hits.total` is rendered as an integer in the response. If `false`, it is rendered as an object. ** *`typed_keys` (Optional, boolean)*: If `true`, the response prefixes aggregation and suggester names with their respective types. [discrete] @@ -1825,12 +1998,10 @@ client.searchTemplate({ ... }) Get terms in an index. Discover terms that match a partial string in an index. -This "terms enum" API is designed for low-latency look-ups used in auto-complete scenarios. +This API is designed for low-latency look-ups used in auto-complete scenarios. -If the `complete` property in the response is false, the returned terms set may be incomplete and should be treated as approximate. -This can occur due to a few reasons, such as a request timeout or a node error. - -NOTE: The terms enum API may return terms from deleted documents. Deleted documents are initially only marked as deleted. It is not until their segments are merged that documents are actually deleted. Until that happens, the terms enum API will return terms from these documents. +> info +> The terms enum API may return terms from deleted documents. Deleted documents are initially only marked as deleted. It is not until their segments are merged that documents are actually deleted. Until that happens, the terms enum API will return terms from these documents. {ref}/search-terms-enum.html[Endpoint documentation] [source,ts] @@ -1841,14 +2012,14 @@ client.termsEnum({ index, field }) ==== Arguments * *Request (object):* -** *`index` (string)*: List of data streams, indices, and index aliases to search. Wildcard (*) expressions are supported. +** *`index` (string)*: A list of data streams, indices, and index aliases to search. Wildcard (`*`) expressions are supported. To search all data streams or indices, omit this parameter or use `*` or `_all`. ** *`field` (string)*: The string to match at the start of indexed terms. If not provided, all terms in the field are considered. -** *`size` (Optional, number)*: How many matching terms to return. -** *`timeout` (Optional, string | -1 | 0)*: The maximum length of time to spend collecting results. Defaults to "1s" (one second). If the timeout is exceeded the complete flag set to false in the response and the results may be partial or empty. -** *`case_insensitive` (Optional, boolean)*: When true the provided search string is matched against index terms without case sensitivity. -** *`index_filter` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Allows to filter an index shard if the provided query rewrites to match_none. -** *`string` (Optional, string)*: The string after which terms in the index should be returned. Allows for a form of pagination if the last result from one request is passed as the search_after parameter for a subsequent request. -** *`search_after` (Optional, string)* +** *`size` (Optional, number)*: The number of matching terms to return. +** *`timeout` (Optional, string | -1 | 0)*: The maximum length of time to spend collecting results. If the timeout is exceeded the `complete` flag set to `false` in the response and the results may be partial or empty. +** *`case_insensitive` (Optional, boolean)*: When `true`, the provided search string is matched against index terms without case sensitivity. +** *`index_filter` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Filter an index shard if the provided query rewrites to `match_none`. +** *`string` (Optional, string)*: The string to match at the start of indexed terms. If it is not provided, all terms in the field are considered. > info > The prefix string cannot be larger than the largest possible keyword value, which is Lucene's term byte-length limit of 32766. +** *`search_after` (Optional, string)*: The string after which terms in the index should be returned. It allows for a form of pagination if the last result from one request is passed as the `search_after` parameter for a subsequent request. [discrete] === termvectors @@ -1856,6 +2027,44 @@ Get term vector information. Get information and statistics about terms in the fields of a particular document. +You can retrieve term vectors for documents stored in the index or for artificial documents passed in the body of the request. +You can specify the fields you are interested in through the `fields` parameter or by adding the fields to the request body. +For example: + +---- +GET /my-index-000001/_termvectors/1?fields=message +---- + +Fields can be specified using wildcards, similar to the multi match query. + +Term vectors are real-time by default, not near real-time. +This can be changed by setting `realtime` parameter to `false`. + +You can request three types of values: _term information_, _term statistics_, and _field statistics_. +By default, all term information and field statistics are returned for all fields but term statistics are excluded. + +**Term information** + +* term frequency in the field (always returned) +* term positions (`positions: true`) +* start and end offsets (`offsets: true`) +* term payloads (`payloads: true`), as base64 encoded bytes + +If the requested information wasn't stored in the index, it will be computed on the fly if possible. +Additionally, term vectors could be computed for documents not even existing in the index, but instead provided by the user. + +> warn +> Start and end offsets assume UTF-16 encoding is being used. If you want to use these offsets in order to get the original text that produced this token, you should make sure that the string you are taking a sub-string of is also encoded using UTF-16. + +**Behaviour** + +The term and field statistics are not accurate. +Deleted documents are not taken into account. +The information is only retrieved for the shard the requested document resides in. +The term and field statistics are therefore only useful as relative measures whereas the absolute numbers have no meaning in this context. +By default, when requesting term vectors of artificial documents, a shard to get the statistics from is randomly selected. +Use `routing` only to hit a particular shard. + {ref}/docs-termvectors.html[Endpoint documentation] [source,ts] ---- @@ -1865,22 +2074,22 @@ client.termvectors({ index }) ==== Arguments * *Request (object):* -** *`index` (string)*: Name of the index that contains the document. -** *`id` (Optional, string)*: Unique identifier of the document. +** *`index` (string)*: The name of the index that contains the document. +** *`id` (Optional, string)*: A unique identifier for the document. ** *`doc` (Optional, object)*: An artificial document (a document not present in the index) for which you want to retrieve term vectors. -** *`filter` (Optional, { max_doc_freq, max_num_terms, max_term_freq, max_word_length, min_doc_freq, min_term_freq, min_word_length })*: Filter terms based on their tf-idf scores. -** *`per_field_analyzer` (Optional, Record)*: Overrides the default per-field analyzer. -** *`fields` (Optional, string | string[])*: List or wildcard expressions of fields to include in the statistics. Used as the default list unless a specific field list is provided in the `completion_fields` or `fielddata_fields` parameters. -** *`field_statistics` (Optional, boolean)*: If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies. +** *`filter` (Optional, { max_doc_freq, max_num_terms, max_term_freq, max_word_length, min_doc_freq, min_term_freq, min_word_length })*: Filter terms based on their tf-idf scores. This could be useful in order find out a good characteristic vector of a document. This feature works in a similar manner to the second phase of the More Like This Query. +** *`per_field_analyzer` (Optional, Record)*: Override the default per-field analyzer. This is useful in order to generate term vectors in any fashion, especially when using artificial documents. When providing an analyzer for a field that already stores term vectors, the term vectors will be regenerated. +** *`fields` (Optional, string | string[])*: A list or wildcard expressions of fields to include in the statistics. It is used as the default list unless a specific field list is provided in the `completion_fields` or `fielddata_fields` parameters. +** *`field_statistics` (Optional, boolean)*: If `true`, the response includes: * The document count (how many documents contain this field). * The sum of document frequencies (the sum of document frequencies for all terms in this field). * The sum of total term frequencies (the sum of total term frequencies of each term in this field). ** *`offsets` (Optional, boolean)*: If `true`, the response includes term offsets. ** *`payloads` (Optional, boolean)*: If `true`, the response includes term payloads. ** *`positions` (Optional, boolean)*: If `true`, the response includes term positions. -** *`preference` (Optional, string)*: Specifies the node or shard the operation should be performed on. Random by default. +** *`preference` (Optional, string)*: The node or shard the operation should be performed on. It is random by default. ** *`realtime` (Optional, boolean)*: If true, the request is real-time as opposed to near-real-time. -** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. -** *`term_statistics` (Optional, boolean)*: If `true`, the response includes term frequency and document frequency. +** *`routing` (Optional, string)*: A custom value that is used to route operations to a specific shard. +** *`term_statistics` (Optional, boolean)*: If `true`, the response includes: * The total term frequency (how often a term occurs in all documents). * The document frequency (the number of documents containing the current term). By default these values are not returned since term statistics can have a serious performance impact. ** *`version` (Optional, number)*: If `true`, returns the document version as part of a hit. -** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type. +** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: The version type. [discrete] === update @@ -13036,7 +13245,7 @@ client.simulate.ingest({ docs }) ** *`index` (Optional, string)*: The index to simulate ingesting into. This value can be overridden by specifying an index on each document. If you specify this parameter in the request path, it is used for any documents that do not explicitly specify an index argument. -** *`component_template_substitutions` (Optional, Record)*: A map of component template names to substitute component template definition objects. +** *`component_template_substitutions` (Optional, Record)*: A map of component template names to substitute component template definition objects. ** *`index_template_subtitutions` (Optional, Record)*: A map of index template names to substitute index template definition objects. ** *`mapping_addition` (Optional, { all_field, date_detection, dynamic, dynamic_date_formats, dynamic_templates, _field_names, index_field, _meta, numeric_detection, properties, _routing, _size, _source, runtime, enabled, subobjects, _data_stream_timestamp })* ** *`pipeline_substitutions` (Optional, Record)*: Pipelines to test. diff --git a/src/api/api/count.ts b/src/api/api/count.ts index 286a8107d..3aa04a831 100644 --- a/src/api/api/count.ts +++ b/src/api/api/count.ts @@ -39,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Count search results. Get the number of documents matching a query. The query can either be provided using a simple query string as a parameter or using the Query DSL defined within the request body. The latter must be nested in a `query` key, which is the same as the search API. The count API supports multi-target syntax. You can run a single count API search across multiple data streams and indices. The operation is broadcast across all shards. For each shard ID group, a replica is chosen and the search is run against it. This means that replicas increase the scalability of the count. + * Count search results. Get the number of documents matching a query. The query can be provided either by using a simple query string as a parameter, or by defining Query DSL within the request body. The query is optional. When no query is provided, the API uses `match_all` to count all the documents. The count API supports multi-target syntax. You can run a single count API search across multiple data streams and indices. The operation is broadcast across all shards. For each shard ID group, a replica is chosen and the search is run against it. This means that replicas increase the scalability of the count. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-count.html | Elasticsearch API documentation} */ export default async function CountApi (this: That, params?: T.CountRequest | TB.CountRequest, options?: TransportRequestOptionsWithOutMeta): Promise diff --git a/src/api/api/delete_script.ts b/src/api/api/delete_script.ts index 3b19a496b..20b220fcc 100644 --- a/src/api/api/delete_script.ts +++ b/src/api/api/delete_script.ts @@ -40,7 +40,7 @@ interface That { transport: Transport } /** * Delete a script or search template. Deletes a stored script or search template. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/modules-scripting.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/delete-stored-script-api.html | Elasticsearch API documentation} */ export default async function DeleteScriptApi (this: That, params: T.DeleteScriptRequest | TB.DeleteScriptRequest, options?: TransportRequestOptionsWithOutMeta): Promise export default async function DeleteScriptApi (this: That, params: T.DeleteScriptRequest | TB.DeleteScriptRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/explain.ts b/src/api/api/explain.ts index 4f6c58d90..6c3419d56 100644 --- a/src/api/api/explain.ts +++ b/src/api/api/explain.ts @@ -39,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Explain a document match result. Returns information about why a specific document matches, or doesn’t match, a query. + * Explain a document match result. Get information about why a specific document matches, or doesn't match, a query. It computes a score explanation for a query and a specific document. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-explain.html | Elasticsearch API documentation} */ export default async function ExplainApi (this: That, params: T.ExplainRequest | TB.ExplainRequest, options?: TransportRequestOptionsWithOutMeta): Promise> diff --git a/src/api/api/get_script_context.ts b/src/api/api/get_script_context.ts index 88648d78b..e99b2f0a6 100644 --- a/src/api/api/get_script_context.ts +++ b/src/api/api/get_script_context.ts @@ -40,7 +40,7 @@ interface That { transport: Transport } /** * Get script contexts. Get a list of supported script contexts and their methods. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/painless/8.17/painless-contexts.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-script-contexts-api.html | Elasticsearch API documentation} */ export default async function GetScriptContextApi (this: That, params?: T.GetScriptContextRequest | TB.GetScriptContextRequest, options?: TransportRequestOptionsWithOutMeta): Promise export default async function GetScriptContextApi (this: That, params?: T.GetScriptContextRequest | TB.GetScriptContextRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/get_script_languages.ts b/src/api/api/get_script_languages.ts index 40ee3119b..7fb149d7a 100644 --- a/src/api/api/get_script_languages.ts +++ b/src/api/api/get_script_languages.ts @@ -40,7 +40,7 @@ interface That { transport: Transport } /** * Get script languages. Get a list of available script types, languages, and contexts. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/modules-scripting.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-script-languages-api.html | Elasticsearch API documentation} */ export default async function GetScriptLanguagesApi (this: That, params?: T.GetScriptLanguagesRequest | TB.GetScriptLanguagesRequest, options?: TransportRequestOptionsWithOutMeta): Promise export default async function GetScriptLanguagesApi (this: That, params?: T.GetScriptLanguagesRequest | TB.GetScriptLanguagesRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/knn_search.ts b/src/api/api/knn_search.ts index 1ff41fb38..fd5dd6c1e 100644 --- a/src/api/api/knn_search.ts +++ b/src/api/api/knn_search.ts @@ -39,8 +39,8 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Run a knn search. NOTE: The kNN search API has been replaced by the `knn` option in the search API. Perform a k-nearest neighbor (kNN) search on a dense_vector field and return the matching documents. Given a query vector, the API finds the k closest vectors and returns those documents as search hits. Elasticsearch uses the HNSW algorithm to support efficient kNN search. Like most kNN algorithms, HNSW is an approximate method that sacrifices result accuracy for improved search speed. This means the results returned are not always the true k closest neighbors. The kNN search API supports restricting the search using a filter. The search will return the top k documents that also match the filter query. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-search.html | Elasticsearch API documentation} + * Run a knn search. NOTE: The kNN search API has been replaced by the `knn` option in the search API. Perform a k-nearest neighbor (kNN) search on a dense_vector field and return the matching documents. Given a query vector, the API finds the k closest vectors and returns those documents as search hits. Elasticsearch uses the HNSW algorithm to support efficient kNN search. Like most kNN algorithms, HNSW is an approximate method that sacrifices result accuracy for improved search speed. This means the results returned are not always the true k closest neighbors. The kNN search API supports restricting the search using a filter. The search will return the top k documents that also match the filter query. A kNN search response has the exact same structure as a search API response. However, certain sections have a meaning specific to kNN search: * The document `_score` is determined by the similarity between the query and document vector. * The `hits.total` object contains the total number of nearest neighbor candidates considered, which is `num_candidates * num_shards`. The `hits.total.relation` will always be `eq`, indicating an exact value. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/knn-search-api.html | Elasticsearch API documentation} */ export default async function KnnSearchApi (this: That, params: T.KnnSearchRequest | TB.KnnSearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise> export default async function KnnSearchApi (this: That, params: T.KnnSearchRequest | TB.KnnSearchRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> diff --git a/src/api/api/mget.ts b/src/api/api/mget.ts index 45fd11696..ccae24356 100644 --- a/src/api/api/mget.ts +++ b/src/api/api/mget.ts @@ -39,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Get multiple documents. Get multiple JSON documents by ID from one or more indices. If you specify an index in the request URI, you only need to specify the document IDs in the request body. To ensure fast responses, this multi get (mget) API responds with partial results if one or more shards fail. + * Get multiple documents. Get multiple JSON documents by ID from one or more indices. If you specify an index in the request URI, you only need to specify the document IDs in the request body. To ensure fast responses, this multi get (mget) API responds with partial results if one or more shards fail. **Filter source fields** By default, the `_source` field is returned for every document (if stored). Use the `_source` and `_source_include` or `source_exclude` attributes to filter what fields are returned for a particular document. You can include the `_source`, `_source_includes`, and `_source_excludes` query parameters in the request URI to specify the defaults to use when there are no per-document instructions. **Get stored fields** Use the `stored_fields` attribute to specify the set of stored fields you want to retrieve. Any requested fields that are not stored are ignored. You can include the `stored_fields` query parameter in the request URI to specify the defaults to use when there are no per-document instructions. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/docs-multi-get.html | Elasticsearch API documentation} */ export default async function MgetApi (this: That, params?: T.MgetRequest | TB.MgetRequest, options?: TransportRequestOptionsWithOutMeta): Promise> diff --git a/src/api/api/msearch_template.ts b/src/api/api/msearch_template.ts index a7062b147..0b4cc0d9a 100644 --- a/src/api/api/msearch_template.ts +++ b/src/api/api/msearch_template.ts @@ -39,8 +39,8 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Run multiple templated searches. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-multi-search.html | Elasticsearch API documentation} + * Run multiple templated searches. Run multiple templated searches with a single request. If you are providing a text file or text input to `curl`, use the `--data-binary` flag instead of `-d` to preserve newlines. For example: ``` $ cat requests { "index": "my-index" } { "id": "my-search-template", "params": { "query_string": "hello world", "from": 0, "size": 10 }} { "index": "my-other-index" } { "id": "my-other-search-template", "params": { "query_type": "match_all" }} $ curl -H "Content-Type: application/x-ndjson" -XGET localhost:9200/_msearch/template --data-binary "@requests"; echo ``` + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/multi-search-template.html | Elasticsearch API documentation} */ export default async function MsearchTemplateApi> (this: That, params: T.MsearchTemplateRequest | TB.MsearchTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise> export default async function MsearchTemplateApi> (this: That, params: T.MsearchTemplateRequest | TB.MsearchTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> diff --git a/src/api/api/mtermvectors.ts b/src/api/api/mtermvectors.ts index 176ed985d..622f5a055 100644 --- a/src/api/api/mtermvectors.ts +++ b/src/api/api/mtermvectors.ts @@ -39,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Get multiple term vectors. You can specify existing documents by index and ID or provide artificial documents in the body of the request. You can specify the index in the request body or request URI. The response contains a `docs` array with all the fetched termvectors. Each element has the structure provided by the termvectors API. + * Get multiple term vectors. Get multiple term vectors with a single request. You can specify existing documents by index and ID or provide artificial documents in the body of the request. You can specify the index in the request body or request URI. The response contains a `docs` array with all the fetched termvectors. Each element has the structure provided by the termvectors API. **Artificial documents** You can also use `mtermvectors` to generate term vectors for artificial documents provided in the body of the request. The mapping used is determined by the specified `_index`. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/docs-multi-termvectors.html | Elasticsearch API documentation} */ export default async function MtermvectorsApi (this: That, params?: T.MtermvectorsRequest | TB.MtermvectorsRequest, options?: TransportRequestOptionsWithOutMeta): Promise diff --git a/src/api/api/put_script.ts b/src/api/api/put_script.ts index b5a806c41..ac5310719 100644 --- a/src/api/api/put_script.ts +++ b/src/api/api/put_script.ts @@ -40,7 +40,7 @@ interface That { transport: Transport } /** * Create or update a script or search template. Creates or updates a stored script or search template. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/modules-scripting.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/create-stored-script-api.html | Elasticsearch API documentation} */ export default async function PutScriptApi (this: That, params: T.PutScriptRequest | TB.PutScriptRequest, options?: TransportRequestOptionsWithOutMeta): Promise export default async function PutScriptApi (this: That, params: T.PutScriptRequest | TB.PutScriptRequest, options?: TransportRequestOptionsWithMeta): Promise> diff --git a/src/api/api/render_search_template.ts b/src/api/api/render_search_template.ts index a61253b76..239d30f66 100644 --- a/src/api/api/render_search_template.ts +++ b/src/api/api/render_search_template.ts @@ -46,8 +46,8 @@ export default async function RenderSearchTemplateApi (this: That, params?: T.Re export default async function RenderSearchTemplateApi (this: That, params?: T.RenderSearchTemplateRequest | TB.RenderSearchTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> export default async function RenderSearchTemplateApi (this: That, params?: T.RenderSearchTemplateRequest | TB.RenderSearchTemplateRequest, options?: TransportRequestOptions): Promise export default async function RenderSearchTemplateApi (this: That, params?: T.RenderSearchTemplateRequest | TB.RenderSearchTemplateRequest, options?: TransportRequestOptions): Promise { - const acceptedPath: string[] = ['id'] - const acceptedBody: string[] = ['file', 'params', 'source'] + const acceptedPath: string[] = [] + const acceptedBody: string[] = ['id', 'file', 'params', 'source'] const querystring: Record = {} // @ts-expect-error const userBody: any = params?.body diff --git a/src/api/api/scroll.ts b/src/api/api/scroll.ts index be6160335..da0fce822 100644 --- a/src/api/api/scroll.ts +++ b/src/api/api/scroll.ts @@ -40,7 +40,7 @@ interface That { transport: Transport } /** * Run a scrolling search. IMPORTANT: The scroll API is no longer recommend for deep pagination. If you need to preserve the index state while paging through more than 10,000 hits, use the `search_after` parameter with a point in time (PIT). The scroll API gets large sets of results from a single scrolling search request. To get the necessary scroll ID, submit a search API request that includes an argument for the `scroll` query parameter. The `scroll` parameter indicates how long Elasticsearch should retain the search context for the request. The search response returns a scroll ID in the `_scroll_id` response body parameter. You can then use the scroll ID with the scroll API to retrieve the next batch of results for the request. If the Elasticsearch security features are enabled, the access to the results of a specific scroll ID is restricted to the user or API key that submitted the search. You can also use the scroll API to specify a new scroll parameter that extends or shortens the retention period for the search context. IMPORTANT: Results from a scrolling search reflect the state of the index at the time of the initial search request. Subsequent indexing or document changes only affect later search and scroll requests. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-request-body.html#request-body-search-scroll | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/scroll-api.html | Elasticsearch API documentation} */ export default async function ScrollApi> (this: That, params: T.ScrollRequest | TB.ScrollRequest, options?: TransportRequestOptionsWithOutMeta): Promise> export default async function ScrollApi> (this: That, params: T.ScrollRequest | TB.ScrollRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> diff --git a/src/api/api/search_mvt.ts b/src/api/api/search_mvt.ts index 71eafa5b0..35f17f711 100644 --- a/src/api/api/search_mvt.ts +++ b/src/api/api/search_mvt.ts @@ -39,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Search a vector tile. Search a vector tile for geospatial values. + * Search a vector tile. Search a vector tile for geospatial values. Before using this API, you should be familiar with the Mapbox vector tile specification. The API returns results as a binary mapbox vector tile. Internally, Elasticsearch translates a vector tile search API request into a search containing: * A `geo_bounding_box` query on the ``. The query uses the `//` tile as a bounding box. * A `geotile_grid` or `geohex_grid` aggregation on the ``. The `grid_agg` parameter determines the aggregation type. The aggregation uses the `//` tile as a bounding box. * Optionally, a `geo_bounds` aggregation on the ``. The search only includes this aggregation if the `exact_bounds` parameter is `true`. * If the optional parameter `with_labels` is `true`, the internal search will include a dynamic runtime field that calls the `getLabelPosition` function of the geometry doc value. This enables the generation of new point features containing suggested geometry labels, so that, for example, multi-polygons will have only one label. For example, Elasticsearch may translate a vector tile search API request with a `grid_agg` argument of `geotile` and an `exact_bounds` argument of `true` into the following search ``` GET my-index/_search { "size": 10000, "query": { "geo_bounding_box": { "my-geo-field": { "top_left": { "lat": -40.979898069620134, "lon": -45 }, "bottom_right": { "lat": -66.51326044311186, "lon": 0 } } } }, "aggregations": { "grid": { "geotile_grid": { "field": "my-geo-field", "precision": 11, "size": 65536, "bounds": { "top_left": { "lat": -40.979898069620134, "lon": -45 }, "bottom_right": { "lat": -66.51326044311186, "lon": 0 } } } }, "bounds": { "geo_bounds": { "field": "my-geo-field", "wrap_longitude": false } } } } ``` The API returns results as a binary Mapbox vector tile. Mapbox vector tiles are encoded as Google Protobufs (PBF). By default, the tile contains three layers: * A `hits` layer containing a feature for each `` value matching the `geo_bounding_box` query. * An `aggs` layer containing a feature for each cell of the `geotile_grid` or `geohex_grid`. The layer only contains features for cells with matching data. * A meta layer containing: * A feature containing a bounding box. By default, this is the bounding box of the tile. * Value ranges for any sub-aggregations on the `geotile_grid` or `geohex_grid`. * Metadata for the search. The API only returns features that can display at its zoom level. For example, if a polygon feature has no area at its zoom level, the API omits it. The API returns errors as UTF-8 encoded JSON. IMPORTANT: You can specify several options for this API as either a query parameter or request body parameter. If you specify both parameters, the query parameter takes precedence. **Grid precision for geotile** For a `grid_agg` of `geotile`, you can use cells in the `aggs` layer as tiles for lower zoom levels. `grid_precision` represents the additional zoom levels available through these cells. The final precision is computed by as follows: ` + grid_precision`. For example, if `` is 7 and `grid_precision` is 8, then the `geotile_grid` aggregation will use a precision of 15. The maximum final precision is 29. The `grid_precision` also determines the number of cells for the grid as follows: `(2^grid_precision) x (2^grid_precision)`. For example, a value of 8 divides the tile into a grid of 256 x 256 cells. The `aggs` layer only contains features for cells with matching data. **Grid precision for geohex** For a `grid_agg` of `geohex`, Elasticsearch uses `` and `grid_precision` to calculate a final precision as follows: ` + grid_precision`. This precision determines the H3 resolution of the hexagonal cells produced by the `geohex` aggregation. The following table maps the H3 resolution for each precision. For example, if `` is 3 and `grid_precision` is 3, the precision is 6. At a precision of 6, hexagonal cells have an H3 resolution of 2. If `` is 3 and `grid_precision` is 4, the precision is 7. At a precision of 7, hexagonal cells have an H3 resolution of 3. | Precision | Unique tile bins | H3 resolution | Unique hex bins | Ratio | | --------- | ---------------- | ------------- | ----------------| ----- | | 1 | 4 | 0 | 122 | 30.5 | | 2 | 16 | 0 | 122 | 7.625 | | 3 | 64 | 1 | 842 | 13.15625 | | 4 | 256 | 1 | 842 | 3.2890625 | | 5 | 1024 | 2 | 5882 | 5.744140625 | | 6 | 4096 | 2 | 5882 | 1.436035156 | | 7 | 16384 | 3 | 41162 | 2.512329102 | | 8 | 65536 | 3 | 41162 | 0.6280822754 | | 9 | 262144 | 4 | 288122 | 1.099098206 | | 10 | 1048576 | 4 | 288122 | 0.2747745514 | | 11 | 4194304 | 5 | 2016842 | 0.4808526039 | | 12 | 16777216 | 6 | 14117882 | 0.8414913416 | | 13 | 67108864 | 6 | 14117882 | 0.2103728354 | | 14 | 268435456 | 7 | 98825162 | 0.3681524172 | | 15 | 1073741824 | 8 | 691776122 | 0.644266719 | | 16 | 4294967296 | 8 | 691776122 | 0.1610666797 | | 17 | 17179869184 | 9 | 4842432842 | 0.2818666889 | | 18 | 68719476736 | 10 | 33897029882 | 0.4932667053 | | 19 | 274877906944 | 11 | 237279209162 | 0.8632167343 | | 20 | 1099511627776 | 11 | 237279209162 | 0.2158041836 | | 21 | 4398046511104 | 12 | 1660954464122 | 0.3776573213 | | 22 | 17592186044416 | 13 | 11626681248842 | 0.6609003122 | | 23 | 70368744177664 | 13 | 11626681248842 | 0.165225078 | | 24 | 281474976710656 | 14 | 81386768741882 | 0.2891438866 | | 25 | 1125899906842620 | 15 | 569707381193162 | 0.5060018015 | | 26 | 4503599627370500 | 15 | 569707381193162 | 0.1265004504 | | 27 | 18014398509482000 | 15 | 569707381193162 | 0.03162511259 | | 28 | 72057594037927900 | 15 | 569707381193162 | 0.007906278149 | | 29 | 288230376151712000 | 15 | 569707381193162 | 0.001976569537 | Hexagonal cells don't align perfectly on a vector tile. Some cells may intersect more than one vector tile. To compute the H3 resolution for each precision, Elasticsearch compares the average density of hexagonal bins at each resolution with the average density of tile bins at each zoom level. Elasticsearch uses the H3 resolution that is closest to the corresponding geotile density. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-vector-tile-api.html | Elasticsearch API documentation} */ export default async function SearchMvtApi (this: That, params: T.SearchMvtRequest | TB.SearchMvtRequest, options?: TransportRequestOptionsWithOutMeta): Promise diff --git a/src/api/api/search_shards.ts b/src/api/api/search_shards.ts index 852615082..c19ebf253 100644 --- a/src/api/api/search_shards.ts +++ b/src/api/api/search_shards.ts @@ -39,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Get the search shards. Get the indices and shards that a search request would be run against. This information can be useful for working out issues or planning optimizations with routing and shard preferences. When filtered aliases are used, the filter is returned as part of the indices section. + * Get the search shards. Get the indices and shards that a search request would be run against. This information can be useful for working out issues or planning optimizations with routing and shard preferences. When filtered aliases are used, the filter is returned as part of the `indices` section. If the Elasticsearch security features are enabled, you must have the `view_index_metadata` or `manage` index privilege for the target data stream, index, or alias. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-shards.html | Elasticsearch API documentation} */ export default async function SearchShardsApi (this: That, params?: T.SearchShardsRequest | TB.SearchShardsRequest, options?: TransportRequestOptionsWithOutMeta): Promise diff --git a/src/api/api/search_template.ts b/src/api/api/search_template.ts index b5dace73a..d7f9acc0b 100644 --- a/src/api/api/search_template.ts +++ b/src/api/api/search_template.ts @@ -40,7 +40,7 @@ interface That { transport: Transport } /** * Run a search with a search template. - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-template.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-template-api.html | Elasticsearch API documentation} */ export default async function SearchTemplateApi (this: That, params?: T.SearchTemplateRequest | TB.SearchTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise> export default async function SearchTemplateApi (this: That, params?: T.SearchTemplateRequest | TB.SearchTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> diff --git a/src/api/api/terms_enum.ts b/src/api/api/terms_enum.ts index a29d55635..b206128de 100644 --- a/src/api/api/terms_enum.ts +++ b/src/api/api/terms_enum.ts @@ -39,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Get terms in an index. Discover terms that match a partial string in an index. This "terms enum" API is designed for low-latency look-ups used in auto-complete scenarios. If the `complete` property in the response is false, the returned terms set may be incomplete and should be treated as approximate. This can occur due to a few reasons, such as a request timeout or a node error. NOTE: The terms enum API may return terms from deleted documents. Deleted documents are initially only marked as deleted. It is not until their segments are merged that documents are actually deleted. Until that happens, the terms enum API will return terms from these documents. + * Get terms in an index. Discover terms that match a partial string in an index. This API is designed for low-latency look-ups used in auto-complete scenarios. > info > The terms enum API may return terms from deleted documents. Deleted documents are initially only marked as deleted. It is not until their segments are merged that documents are actually deleted. Until that happens, the terms enum API will return terms from these documents. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-terms-enum.html | Elasticsearch API documentation} */ export default async function TermsEnumApi (this: That, params: T.TermsEnumRequest | TB.TermsEnumRequest, options?: TransportRequestOptionsWithOutMeta): Promise diff --git a/src/api/api/termvectors.ts b/src/api/api/termvectors.ts index bcc854a45..34f059597 100644 --- a/src/api/api/termvectors.ts +++ b/src/api/api/termvectors.ts @@ -39,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Get term vector information. Get information and statistics about terms in the fields of a particular document. + * Get term vector information. Get information and statistics about terms in the fields of a particular document. You can retrieve term vectors for documents stored in the index or for artificial documents passed in the body of the request. You can specify the fields you are interested in through the `fields` parameter or by adding the fields to the request body. For example: ``` GET /my-index-000001/_termvectors/1?fields=message ``` Fields can be specified using wildcards, similar to the multi match query. Term vectors are real-time by default, not near real-time. This can be changed by setting `realtime` parameter to `false`. You can request three types of values: _term information_, _term statistics_, and _field statistics_. By default, all term information and field statistics are returned for all fields but term statistics are excluded. **Term information** * term frequency in the field (always returned) * term positions (`positions: true`) * start and end offsets (`offsets: true`) * term payloads (`payloads: true`), as base64 encoded bytes If the requested information wasn't stored in the index, it will be computed on the fly if possible. Additionally, term vectors could be computed for documents not even existing in the index, but instead provided by the user. > warn > Start and end offsets assume UTF-16 encoding is being used. If you want to use these offsets in order to get the original text that produced this token, you should make sure that the string you are taking a sub-string of is also encoded using UTF-16. **Behaviour** The term and field statistics are not accurate. Deleted documents are not taken into account. The information is only retrieved for the shard the requested document resides in. The term and field statistics are therefore only useful as relative measures whereas the absolute numbers have no meaning in this context. By default, when requesting term vectors of artificial documents, a shard to get the statistics from is randomly selected. Use `routing` only to hit a particular shard. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/docs-termvectors.html | Elasticsearch API documentation} */ export default async function TermvectorsApi (this: That, params: T.TermvectorsRequest | TB.TermvectorsRequest, options?: TransportRequestOptionsWithOutMeta): Promise diff --git a/src/api/types.ts b/src/api/types.ts index 09901b381..1a1bf4c61 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -2242,7 +2242,7 @@ export interface ErrorResponseBase { status: integer } -export type EsqlColumns = ArrayBuffer +export type EsqlResult = ArrayBuffer export type ExpandWildcard = 'all' | 'open' | 'closed' | 'hidden' | 'none' @@ -5637,6 +5637,7 @@ export interface MappingPropertyBase { ignore_above?: integer dynamic?: MappingDynamicMapping fields?: Record + synthetic_source_keep?: MappingSyntheticSourceKeepEnum } export interface MappingRangePropertyBase extends MappingDocValuesPropertyBase { @@ -5743,6 +5744,8 @@ export interface MappingSuggestContext { precision?: integer | string } +export type MappingSyntheticSourceKeepEnum = 'none' | 'arrays' | 'all' + export type MappingTermVectorOption = 'no' | 'yes' | 'with_offsets' | 'with_positions' | 'with_positions_offsets' | 'with_positions_offsets_payloads' | 'with_positions_payloads' export interface MappingTextIndexPrefixes { @@ -8891,6 +8894,7 @@ export interface ClusterComponentTemplateNode { template: ClusterComponentTemplateSummary version?: VersionNumber _meta?: Metadata + deprecated?: boolean } export interface ClusterComponentTemplateSummary { @@ -10289,8 +10293,6 @@ export type EqlSearchResponse = EqlEqlSearchResponseBase> } -export interface EsqlAsyncQueryResponse { - columns?: EsqlColumns - id?: string - is_running: boolean -} +export type EsqlAsyncQueryResponse = EsqlResult export interface EsqlAsyncQueryDeleteRequest extends RequestBase { id: Id @@ -10341,13 +10339,12 @@ export interface EsqlAsyncQueryGetRequest extends RequestBase { wait_for_completion_timeout?: Duration } -export interface EsqlAsyncQueryGetResponse { - columns?: EsqlColumns - is_running: boolean -} +export type EsqlAsyncQueryGetResponse = EsqlResult + +export type EsqlQueryEsqlFormat = 'csv' | 'json' | 'tsv' | 'txt' | 'yaml' | 'cbor' | 'smile' | 'arrow' export interface EsqlQueryRequest extends RequestBase { - format?: EsqlEsqlFormat + format?: EsqlQueryEsqlFormat delimiter?: string drop_null_columns?: boolean columnar?: boolean @@ -10359,7 +10356,7 @@ export interface EsqlQueryRequest extends RequestBase { tables?: Record> } -export type EsqlQueryResponse = EsqlColumns +export type EsqlQueryResponse = EsqlResult export interface FeaturesFeature { name: string @@ -11119,7 +11116,8 @@ export interface IndicesMappingLimitSettings { nested_objects?: IndicesMappingLimitSettingsNestedObjects field_name_length?: IndicesMappingLimitSettingsFieldNameLength dimension_fields?: IndicesMappingLimitSettingsDimensionFields - ignore_malformed?: boolean + source?: IndicesMappingLimitSettingsSourceFields + ignore_malformed?: boolean | string } export interface IndicesMappingLimitSettingsDepth { @@ -11142,6 +11140,10 @@ export interface IndicesMappingLimitSettingsNestedObjects { limit?: long } +export interface IndicesMappingLimitSettingsSourceFields { + mode: IndicesSourceMode +} + export interface IndicesMappingLimitSettingsTotalFields { limit?: long | string ignore_dynamic_beyond_limit?: boolean | string @@ -11269,6 +11271,8 @@ export interface IndicesSoftDeletes { retention_lease?: IndicesRetentionLease } +export type IndicesSourceMode = 'DISABLED' | 'STORED' | 'SYNTHETIC' + export interface IndicesStorage { type: IndicesStorageType allow_mmap?: boolean @@ -19324,12 +19328,7 @@ export interface SnapshotRepositoryAnalyzeDetailsInfo { write_elapsed_nanos: DurationValue write_throttled: Duration write_throttled_nanos: DurationValue - writer_node: SnapshotRepositoryAnalyzeNodeInfo -} - -export interface SnapshotRepositoryAnalyzeNodeInfo { - id: Id - name: Name + writer_node: SnapshotRepositoryAnalyzeSnapshotNodeInfo } export interface SnapshotRepositoryAnalyzeReadBlobDetails { @@ -19339,7 +19338,7 @@ export interface SnapshotRepositoryAnalyzeReadBlobDetails { first_byte_time?: Duration first_byte_time_nanos: DurationValue found: boolean - node: SnapshotRepositoryAnalyzeNodeInfo + node: SnapshotRepositoryAnalyzeSnapshotNodeInfo throttled?: Duration throttled_nanos?: DurationValue } @@ -19378,7 +19377,7 @@ export interface SnapshotRepositoryAnalyzeResponse { blob_count: integer blob_path: string concurrency: integer - coordinating_node: SnapshotRepositoryAnalyzeNodeInfo + coordinating_node: SnapshotRepositoryAnalyzeSnapshotNodeInfo delete_elapsed: Duration delete_elapsed_nanos: DurationValue details: SnapshotRepositoryAnalyzeDetailsInfo @@ -19397,6 +19396,11 @@ export interface SnapshotRepositoryAnalyzeResponse { summary: SnapshotRepositoryAnalyzeSummaryInfo } +export interface SnapshotRepositoryAnalyzeSnapshotNodeInfo { + id: Id + name: Name +} + export interface SnapshotRepositoryAnalyzeSummaryInfo { read: SnapshotRepositoryAnalyzeReadSummaryInfo write: SnapshotRepositoryAnalyzeWriteSummaryInfo diff --git a/src/api/typesWithBodyKey.ts b/src/api/typesWithBodyKey.ts index bd32add27..90df6aebb 100644 --- a/src/api/typesWithBodyKey.ts +++ b/src/api/typesWithBodyKey.ts @@ -1157,6 +1157,7 @@ export interface RenderSearchTemplateRequest extends RequestBase { id?: Id /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ body?: { + id?: Id file?: string params?: Record source?: string @@ -2318,7 +2319,7 @@ export interface ErrorResponseBase { status: integer } -export type EsqlColumns = ArrayBuffer +export type EsqlResult = ArrayBuffer export type ExpandWildcard = 'all' | 'open' | 'closed' | 'hidden' | 'none' @@ -5713,6 +5714,7 @@ export interface MappingPropertyBase { ignore_above?: integer dynamic?: MappingDynamicMapping fields?: Record + synthetic_source_keep?: MappingSyntheticSourceKeepEnum } export interface MappingRangePropertyBase extends MappingDocValuesPropertyBase { @@ -5819,6 +5821,8 @@ export interface MappingSuggestContext { precision?: integer | string } +export type MappingSyntheticSourceKeepEnum = 'none' | 'arrays' | 'all' + export type MappingTermVectorOption = 'no' | 'yes' | 'with_offsets' | 'with_positions' | 'with_positions_offsets' | 'with_positions_offsets_payloads' | 'with_positions_payloads' export interface MappingTextIndexPrefixes { @@ -8983,6 +8987,7 @@ export interface ClusterComponentTemplateNode { template: ClusterComponentTemplateSummary version?: VersionNumber _meta?: Metadata + deprecated?: boolean } export interface ClusterComponentTemplateSummary { @@ -10459,8 +10464,6 @@ export type EqlSearchResponse = EqlEqlSearchResponseBase write_throttled: Duration write_throttled_nanos: DurationValue - writer_node: SnapshotRepositoryAnalyzeNodeInfo -} - -export interface SnapshotRepositoryAnalyzeNodeInfo { - id: Id - name: Name + writer_node: SnapshotRepositoryAnalyzeSnapshotNodeInfo } export interface SnapshotRepositoryAnalyzeReadBlobDetails { @@ -19861,7 +19861,7 @@ export interface SnapshotRepositoryAnalyzeReadBlobDetails { first_byte_time?: Duration first_byte_time_nanos: DurationValue found: boolean - node: SnapshotRepositoryAnalyzeNodeInfo + node: SnapshotRepositoryAnalyzeSnapshotNodeInfo throttled?: Duration throttled_nanos?: DurationValue } @@ -19900,7 +19900,7 @@ export interface SnapshotRepositoryAnalyzeResponse { blob_count: integer blob_path: string concurrency: integer - coordinating_node: SnapshotRepositoryAnalyzeNodeInfo + coordinating_node: SnapshotRepositoryAnalyzeSnapshotNodeInfo delete_elapsed: Duration delete_elapsed_nanos: DurationValue details: SnapshotRepositoryAnalyzeDetailsInfo @@ -19919,6 +19919,11 @@ export interface SnapshotRepositoryAnalyzeResponse { summary: SnapshotRepositoryAnalyzeSummaryInfo } +export interface SnapshotRepositoryAnalyzeSnapshotNodeInfo { + id: Id + name: Name +} + export interface SnapshotRepositoryAnalyzeSummaryInfo { read: SnapshotRepositoryAnalyzeReadSummaryInfo write: SnapshotRepositoryAnalyzeWriteSummaryInfo