From 5d4bd654a3089db210c495c2baa7175d726ebf4f Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Mon, 4 Nov 2024 23:10:58 +0100 Subject: [PATCH] Auto-generated code for 8.15 (#2424) --- .../0c8be7aec84ea86b243904f5d4162f5a.asciidoc | 18 ++++ .../18de6782bd18f4a9baec2feec8c02a8b.asciidoc | 18 ---- .../191074b2eebd5f74e628c2ada4b6d2e4.asciidoc | 55 ++++++++++++ ...19f1f9f25933f8e7aba59a10881c648b.asciidoc} | 1 + .../49a19615ebe2c013b8321152163478ab.asciidoc | 42 +++++++++ .../58dd26afc919722e21358c91e112b27a.asciidoc | 18 ++++ ...58f6b72009512851843c7b7a20e9504a.asciidoc} | 2 +- .../77082b1ffaae9ac52dfc133fa597baa7.asciidoc | 18 ++++ .../7a32f44a1511ecb0d3f0b0ff2aca5c44.asciidoc | 23 ----- .../7db798942cf2d334456e30ef5fcb801b.asciidoc | 17 ++++ ...84ef9fe951c6d3caa7438238a5b23319.asciidoc} | 10 ++- .../8d05862be1f9e7edaba162b1888b5677.asciidoc | 61 +++++++++++++ .../96e88611f99e6834bd64b58dc8a282c1.asciidoc | 18 ---- .../aab810de3314d5e11bd564ea096785b8.asciidoc | 21 +++++ .../add82cbe7cd95c4be5ce1c9958f2f208.asciidoc | 16 ++++ .../bb5a67e3d2d9cd3016e487e627769fe8.asciidoc | 88 +++++++++++++++++++ .../bc01aee2ab2ce1690986374bd836e1c7.asciidoc | 16 ++++ ...c8fa8d7e029792d539464fede18ce258.asciidoc} | 1 + ...f8f960550104c33e00dc78bc8723ccef.asciidoc} | 9 +- src/api/types.ts | 6 +- src/api/typesWithBodyKey.ts | 6 +- 21 files changed, 387 insertions(+), 77 deletions(-) create mode 100644 docs/doc_examples/0c8be7aec84ea86b243904f5d4162f5a.asciidoc delete mode 100644 docs/doc_examples/18de6782bd18f4a9baec2feec8c02a8b.asciidoc create mode 100644 docs/doc_examples/191074b2eebd5f74e628c2ada4b6d2e4.asciidoc rename docs/doc_examples/{5f16358ebb5d14b86f57612d5f92d923.asciidoc => 19f1f9f25933f8e7aba59a10881c648b.asciidoc} (89%) create mode 100644 docs/doc_examples/49a19615ebe2c013b8321152163478ab.asciidoc create mode 100644 docs/doc_examples/58dd26afc919722e21358c91e112b27a.asciidoc rename docs/doc_examples/{7a2fdfd7b0553d63440af7598f9ad867.asciidoc => 58f6b72009512851843c7b7a20e9504a.asciidoc} (94%) create mode 100644 docs/doc_examples/77082b1ffaae9ac52dfc133fa597baa7.asciidoc delete mode 100644 docs/doc_examples/7a32f44a1511ecb0d3f0b0ff2aca5c44.asciidoc create mode 100644 docs/doc_examples/7db798942cf2d334456e30ef5fcb801b.asciidoc rename docs/doc_examples/{2f67db5e4d6c958258c3d70fb2d0b1c8.asciidoc => 84ef9fe951c6d3caa7438238a5b23319.asciidoc} (53%) create mode 100644 docs/doc_examples/8d05862be1f9e7edaba162b1888b5677.asciidoc delete mode 100644 docs/doc_examples/96e88611f99e6834bd64b58dc8a282c1.asciidoc create mode 100644 docs/doc_examples/aab810de3314d5e11bd564ea096785b8.asciidoc create mode 100644 docs/doc_examples/add82cbe7cd95c4be5ce1c9958f2f208.asciidoc create mode 100644 docs/doc_examples/bb5a67e3d2d9cd3016e487e627769fe8.asciidoc create mode 100644 docs/doc_examples/bc01aee2ab2ce1690986374bd836e1c7.asciidoc rename docs/doc_examples/{8a0b5f759de3f27f0801c1176e616117.asciidoc => c8fa8d7e029792d539464fede18ce258.asciidoc} (89%) rename docs/doc_examples/{67154a4837cf996a9a9c3e61d6e9d1b3.asciidoc => f8f960550104c33e00dc78bc8723ccef.asciidoc} (56%) diff --git a/docs/doc_examples/0c8be7aec84ea86b243904f5d4162f5a.asciidoc b/docs/doc_examples/0c8be7aec84ea86b243904f5d4162f5a.asciidoc new file mode 100644 index 000000000..54759101e --- /dev/null +++ b/docs/doc_examples/0c8be7aec84ea86b243904f5d4162f5a.asciidoc @@ -0,0 +1,18 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + index: "cooking_blog", + query: { + match: { + title: { + query: "fluffy pancakes breakfast", + minimum_should_match: 2, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/18de6782bd18f4a9baec2feec8c02a8b.asciidoc b/docs/doc_examples/18de6782bd18f4a9baec2feec8c02a8b.asciidoc deleted file mode 100644 index d89eb07d1..000000000 --- a/docs/doc_examples/18de6782bd18f4a9baec2feec8c02a8b.asciidoc +++ /dev/null @@ -1,18 +0,0 @@ -// This file is autogenerated, DO NOT EDIT -// Use `node scripts/generate-docs-examples.js` to generate the docs examples - -[source, js] ----- -const response = await client.indices.create({ - index: "my-index-000002", - mappings: { - properties: { - datetime: { - type: "date", - format: "uuuu/MM/dd HH:mm:ss||uuuu/MM/dd||epoch_millis", - }, - }, - }, -}); -console.log(response); ----- diff --git a/docs/doc_examples/191074b2eebd5f74e628c2ada4b6d2e4.asciidoc b/docs/doc_examples/191074b2eebd5f74e628c2ada4b6d2e4.asciidoc new file mode 100644 index 000000000..9b24f99c0 --- /dev/null +++ b/docs/doc_examples/191074b2eebd5f74e628c2ada4b6d2e4.asciidoc @@ -0,0 +1,55 @@ +// 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: "cooking_blog", + query: { + bool: { + must: [ + { + term: { + "category.keyword": "Main Course", + }, + }, + { + term: { + tags: "vegetarian", + }, + }, + { + range: { + rating: { + gte: 4.5, + }, + }, + }, + ], + should: [ + { + multi_match: { + query: "curry spicy", + fields: ["title^2", "description"], + }, + }, + { + range: { + date: { + gte: "now-1M/d", + }, + }, + }, + ], + must_not: [ + { + term: { + "category.keyword": "Dessert", + }, + }, + ], + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/5f16358ebb5d14b86f57612d5f92d923.asciidoc b/docs/doc_examples/19f1f9f25933f8e7aba59a10881c648b.asciidoc similarity index 89% rename from docs/doc_examples/5f16358ebb5d14b86f57612d5f92d923.asciidoc rename to docs/doc_examples/19f1f9f25933f8e7aba59a10881c648b.asciidoc index 454dd9502..1d9708b3c 100644 --- a/docs/doc_examples/5f16358ebb5d14b86f57612d5f92d923.asciidoc +++ b/docs/doc_examples/19f1f9f25933f8e7aba59a10881c648b.asciidoc @@ -9,6 +9,7 @@ const response = await client.indices.create({ properties: { inference_field: { type: "semantic_text", + inference_id: "my-elser-endpoint", }, }, }, diff --git a/docs/doc_examples/49a19615ebe2c013b8321152163478ab.asciidoc b/docs/doc_examples/49a19615ebe2c013b8321152163478ab.asciidoc new file mode 100644 index 000000000..0c497534a --- /dev/null +++ b/docs/doc_examples/49a19615ebe2c013b8321152163478ab.asciidoc @@ -0,0 +1,42 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.index({ + index: "my-index-000001", + id: 1, + refresh: "true", + document: { + text: "quick brown fox", + }, +}); +console.log(response); + +const response1 = await client.index({ + index: "my-index-000001", + id: 2, + refresh: "true", + document: { + text: "quick fox", + }, +}); +console.log(response1); + +const response2 = await client.search({ + index: "my-index-000001", + query: { + script_score: { + query: { + match: { + text: "quick brown fox", + }, + }, + script: { + source: "_termStats.termFreq().getAverage()", + }, + }, + }, +}); +console.log(response2); +---- diff --git a/docs/doc_examples/58dd26afc919722e21358c91e112b27a.asciidoc b/docs/doc_examples/58dd26afc919722e21358c91e112b27a.asciidoc new file mode 100644 index 000000000..61938b700 --- /dev/null +++ b/docs/doc_examples/58dd26afc919722e21358c91e112b27a.asciidoc @@ -0,0 +1,18 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + index: "cooking_blog", + query: { + range: { + date: { + gte: "2023-05-01", + lte: "2023-05-31", + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/7a2fdfd7b0553d63440af7598f9ad867.asciidoc b/docs/doc_examples/58f6b72009512851843c7b7a20e9504a.asciidoc similarity index 94% rename from docs/doc_examples/7a2fdfd7b0553d63440af7598f9ad867.asciidoc rename to docs/doc_examples/58f6b72009512851843c7b7a20e9504a.asciidoc index 63fb1f69a..ab21c2d80 100644 --- a/docs/doc_examples/7a2fdfd7b0553d63440af7598f9ad867.asciidoc +++ b/docs/doc_examples/58f6b72009512851843c7b7a20e9504a.asciidoc @@ -4,7 +4,7 @@ [source, js] ---- const response = await client.indices.create({ - index: "my-index-000003", + index: "my-index-000002", mappings: { properties: { inference_field: { diff --git a/docs/doc_examples/77082b1ffaae9ac52dfc133fa597baa7.asciidoc b/docs/doc_examples/77082b1ffaae9ac52dfc133fa597baa7.asciidoc new file mode 100644 index 000000000..9bd1c1eea --- /dev/null +++ b/docs/doc_examples/77082b1ffaae9ac52dfc133fa597baa7.asciidoc @@ -0,0 +1,18 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + index: "cooking_blog", + query: { + match: { + description: { + query: "fluffy pancakes", + operator: "and", + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/7a32f44a1511ecb0d3f0b0ff2aca5c44.asciidoc b/docs/doc_examples/7a32f44a1511ecb0d3f0b0ff2aca5c44.asciidoc deleted file mode 100644 index ab73f60fd..000000000 --- a/docs/doc_examples/7a32f44a1511ecb0d3f0b0ff2aca5c44.asciidoc +++ /dev/null @@ -1,23 +0,0 @@ -// This file is autogenerated, DO NOT EDIT -// Use `node scripts/generate-docs-examples.js` to generate the docs examples - -[source, js] ----- -const response = await client.indices.updateAliases({ - actions: [ - { - remove: { - index: "my-index-000001", - alias: "my-index", - }, - }, - { - add: { - index: "my-index-000002", - alias: "my-index", - }, - }, - ], -}); -console.log(response); ----- diff --git a/docs/doc_examples/7db798942cf2d334456e30ef5fcb801b.asciidoc b/docs/doc_examples/7db798942cf2d334456e30ef5fcb801b.asciidoc new file mode 100644 index 000000000..79ead4d92 --- /dev/null +++ b/docs/doc_examples/7db798942cf2d334456e30ef5fcb801b.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.search({ + index: "cooking_blog", + query: { + match: { + description: { + query: "fluffy pancakes", + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/2f67db5e4d6c958258c3d70fb2d0b1c8.asciidoc b/docs/doc_examples/84ef9fe951c6d3caa7438238a5b23319.asciidoc similarity index 53% rename from docs/doc_examples/2f67db5e4d6c958258c3d70fb2d0b1c8.asciidoc rename to docs/doc_examples/84ef9fe951c6d3caa7438238a5b23319.asciidoc index 839a4d359..5d2ef1d8d 100644 --- a/docs/doc_examples/2f67db5e4d6c958258c3d70fb2d0b1c8.asciidoc +++ b/docs/doc_examples/84ef9fe951c6d3caa7438238a5b23319.asciidoc @@ -3,10 +3,12 @@ [source, js] ---- -const response = await client.indices.putSettings({ - index: "my-index-000001", - settings: { - "index.merge.policy.max_merge_at_once_explicit": null, +const response = await client.search({ + index: "cooking_blog", + query: { + term: { + "author.keyword": "Maria Rodriguez", + }, }, }); console.log(response); diff --git a/docs/doc_examples/8d05862be1f9e7edaba162b1888b5677.asciidoc b/docs/doc_examples/8d05862be1f9e7edaba162b1888b5677.asciidoc new file mode 100644 index 000000000..0241e351c --- /dev/null +++ b/docs/doc_examples/8d05862be1f9e7edaba162b1888b5677.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.indices.putMapping({ + index: "cooking_blog", + properties: { + title: { + type: "text", + analyzer: "standard", + fields: { + keyword: { + type: "keyword", + ignore_above: 256, + }, + }, + }, + description: { + type: "text", + fields: { + keyword: { + type: "keyword", + }, + }, + }, + author: { + type: "text", + fields: { + keyword: { + type: "keyword", + }, + }, + }, + date: { + type: "date", + format: "yyyy-MM-dd", + }, + category: { + type: "text", + fields: { + keyword: { + type: "keyword", + }, + }, + }, + tags: { + type: "text", + fields: { + keyword: { + type: "keyword", + }, + }, + }, + rating: { + type: "float", + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/96e88611f99e6834bd64b58dc8a282c1.asciidoc b/docs/doc_examples/96e88611f99e6834bd64b58dc8a282c1.asciidoc deleted file mode 100644 index d3786611f..000000000 --- a/docs/doc_examples/96e88611f99e6834bd64b58dc8a282c1.asciidoc +++ /dev/null @@ -1,18 +0,0 @@ -// This file is autogenerated, DO NOT EDIT -// Use `node scripts/generate-docs-examples.js` to generate the docs examples - -[source, js] ----- -const response = await client.indices.create({ - index: "my-index-000002", - mappings: { - properties: { - inference_field: { - type: "semantic_text", - inference_id: "my-openai-endpoint", - }, - }, - }, -}); -console.log(response); ----- diff --git a/docs/doc_examples/aab810de3314d5e11bd564ea096785b8.asciidoc b/docs/doc_examples/aab810de3314d5e11bd564ea096785b8.asciidoc new file mode 100644 index 000000000..5ab6d8d6d --- /dev/null +++ b/docs/doc_examples/aab810de3314d5e11bd564ea096785b8.asciidoc @@ -0,0 +1,21 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + index: "cooking_blog", + query: { + bool: { + filter: [ + { + term: { + "category.keyword": "Breakfast", + }, + }, + ], + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/add82cbe7cd95c4be5ce1c9958f2f208.asciidoc b/docs/doc_examples/add82cbe7cd95c4be5ce1c9958f2f208.asciidoc new file mode 100644 index 000000000..f924148c0 --- /dev/null +++ b/docs/doc_examples/add82cbe7cd95c4be5ce1c9958f2f208.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.search({ + index: "cooking_blog", + query: { + multi_match: { + query: "vegetarian curry", + fields: ["title^3", "description^2", "tags"], + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/bb5a67e3d2d9cd3016e487e627769fe8.asciidoc b/docs/doc_examples/bb5a67e3d2d9cd3016e487e627769fe8.asciidoc new file mode 100644 index 000000000..d73057f5b --- /dev/null +++ b/docs/doc_examples/bb5a67e3d2d9cd3016e487e627769fe8.asciidoc @@ -0,0 +1,88 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.bulk({ + index: "cooking_blog", + refresh: "wait_for", + operations: [ + { + index: { + _id: "1", + }, + }, + { + title: "Perfect Pancakes: A Fluffy Breakfast Delight", + description: + "Learn the secrets to making the fluffiest pancakes, so amazing you won't believe your tastebuds. This recipe uses buttermilk and a special folding technique to create light, airy pancakes that are perfect for lazy Sunday mornings.", + author: "Maria Rodriguez", + date: "2023-05-01", + category: "Breakfast", + tags: ["pancakes", "breakfast", "easy recipes"], + rating: 4.8, + }, + { + index: { + _id: "2", + }, + }, + { + title: "Spicy Thai Green Curry: A Vegetarian Adventure", + description: + "Dive into the flavors of Thailand with this vibrant green curry. Packed with vegetables and aromatic herbs, this dish is both healthy and satisfying. Don't worry about the heat - you can easily adjust the spice level to your liking.", + author: "Liam Chen", + date: "2023-05-05", + category: "Main Course", + tags: ["thai", "vegetarian", "curry", "spicy"], + rating: 4.6, + }, + { + index: { + _id: "3", + }, + }, + { + title: "Classic Beef Stroganoff: A Creamy Comfort Food", + description: + "Indulge in this rich and creamy beef stroganoff. Tender strips of beef in a savory mushroom sauce, served over a bed of egg noodles. It's the ultimate comfort food for chilly evenings.", + author: "Emma Watson", + date: "2023-05-10", + category: "Main Course", + tags: ["beef", "pasta", "comfort food"], + rating: 4.7, + }, + { + index: { + _id: "4", + }, + }, + { + title: "Vegan Chocolate Avocado Mousse", + description: + "Discover the magic of avocado in this rich, vegan chocolate mousse. Creamy, indulgent, and secretly healthy, it's the perfect guilt-free dessert for chocolate lovers.", + author: "Alex Green", + date: "2023-05-15", + category: "Dessert", + tags: ["vegan", "chocolate", "avocado", "healthy dessert"], + rating: 4.5, + }, + { + index: { + _id: "5", + }, + }, + { + title: "Crispy Oven-Fried Chicken", + description: + "Get that perfect crunch without the deep fryer! This oven-fried chicken recipe delivers crispy, juicy results every time. A healthier take on the classic comfort food.", + author: "Maria Rodriguez", + date: "2023-05-20", + category: "Main Course", + tags: ["chicken", "oven-fried", "healthy"], + rating: 4.9, + }, + ], +}); +console.log(response); +---- diff --git a/docs/doc_examples/bc01aee2ab2ce1690986374bd836e1c7.asciidoc b/docs/doc_examples/bc01aee2ab2ce1690986374bd836e1c7.asciidoc new file mode 100644 index 000000000..59eabf7be --- /dev/null +++ b/docs/doc_examples/bc01aee2ab2ce1690986374bd836e1c7.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.search({ + index: "cooking_blog", + query: { + multi_match: { + query: "vegetarian curry", + fields: ["title", "description", "tags"], + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/8a0b5f759de3f27f0801c1176e616117.asciidoc b/docs/doc_examples/c8fa8d7e029792d539464fede18ce258.asciidoc similarity index 89% rename from docs/doc_examples/8a0b5f759de3f27f0801c1176e616117.asciidoc rename to docs/doc_examples/c8fa8d7e029792d539464fede18ce258.asciidoc index 5ac85568d..598fd1f7b 100644 --- a/docs/doc_examples/8a0b5f759de3f27f0801c1176e616117.asciidoc +++ b/docs/doc_examples/c8fa8d7e029792d539464fede18ce258.asciidoc @@ -9,6 +9,7 @@ const response = await client.indices.create({ properties: { content: { type: "semantic_text", + inference_id: "my-elser-endpoint", }, }, }, diff --git a/docs/doc_examples/67154a4837cf996a9a9c3e61d6e9d1b3.asciidoc b/docs/doc_examples/f8f960550104c33e00dc78bc8723ccef.asciidoc similarity index 56% rename from docs/doc_examples/67154a4837cf996a9a9c3e61d6e9d1b3.asciidoc rename to docs/doc_examples/f8f960550104c33e00dc78bc8723ccef.asciidoc index c60551fda..8d3d91597 100644 --- a/docs/doc_examples/67154a4837cf996a9a9c3e61d6e9d1b3.asciidoc +++ b/docs/doc_examples/f8f960550104c33e00dc78bc8723ccef.asciidoc @@ -3,13 +3,8 @@ [source, js] ---- -const response = await client.reindex({ - source: { - index: "my-index-000001", - }, - dest: { - index: "my-index-000002", - }, +const response = await client.indices.create({ + index: "cooking_blog", }); console.log(response); ---- diff --git a/src/api/types.ts b/src/api/types.ts index 7f4746ed0..4863883e9 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -4667,9 +4667,9 @@ export interface AnalysisNGramTokenFilter extends AnalysisTokenFilterBase { export interface AnalysisNGramTokenizer extends AnalysisTokenizerBase { type: 'ngram' custom_token_chars?: string - max_gram: integer - min_gram: integer - token_chars: AnalysisTokenChar[] + max_gram?: integer + min_gram?: integer + token_chars?: AnalysisTokenChar[] } export interface AnalysisNoriAnalyzer { diff --git a/src/api/typesWithBodyKey.ts b/src/api/typesWithBodyKey.ts index cf6bd36db..0dc3781cf 100644 --- a/src/api/typesWithBodyKey.ts +++ b/src/api/typesWithBodyKey.ts @@ -4740,9 +4740,9 @@ export interface AnalysisNGramTokenFilter extends AnalysisTokenFilterBase { export interface AnalysisNGramTokenizer extends AnalysisTokenizerBase { type: 'ngram' custom_token_chars?: string - max_gram: integer - min_gram: integer - token_chars: AnalysisTokenChar[] + max_gram?: integer + min_gram?: integer + token_chars?: AnalysisTokenChar[] } export interface AnalysisNoriAnalyzer {