Auto-generated code for 8.15 (#2424)

This commit is contained in:
Elastic Machine
2024-11-04 23:10:58 +01:00
committed by GitHub
parent 43175e1a2b
commit 5d4bd654a3
21 changed files with 387 additions and 77 deletions

View File

@ -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);
----

View File

@ -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);
----

View File

@ -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);
----

View File

@ -9,6 +9,7 @@ const response = await client.indices.create({
properties: {
inference_field: {
type: "semantic_text",
inference_id: "my-elser-endpoint",
},
},
},

View File

@ -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);
----

View File

@ -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);
----

View File

@ -4,7 +4,7 @@
[source, js]
----
const response = await client.indices.create({
index: "my-index-000003",
index: "my-index-000002",
mappings: {
properties: {
inference_field: {

View File

@ -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);
----

View File

@ -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);
----

View File

@ -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);
----

View File

@ -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);

View File

@ -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);
----

View File

@ -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);
----

View File

@ -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);
----

View File

@ -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);
----

View File

@ -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);
----

View File

@ -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);
----

View File

@ -9,6 +9,7 @@ const response = await client.indices.create({
properties: {
content: {
type: "semantic_text",
inference_id: "my-elser-endpoint",
},
},
},

View File

@ -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);
----

View File

@ -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 {

View File

@ -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 {