Skip to content

Commit 5d4bd65

Browse files
Auto-generated code for 8.15 (#2424)
1 parent 43175e1 commit 5d4bd65

21 files changed

+387
-77
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// This file is autogenerated, DO NOT EDIT
2+
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
3+
4+
[source, js]
5+
----
6+
const response = await client.search({
7+
index: "cooking_blog",
8+
query: {
9+
match: {
10+
title: {
11+
query: "fluffy pancakes breakfast",
12+
minimum_should_match: 2,
13+
},
14+
},
15+
},
16+
});
17+
console.log(response);
18+
----

docs/doc_examples/18de6782bd18f4a9baec2feec8c02a8b.asciidoc

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// This file is autogenerated, DO NOT EDIT
2+
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
3+
4+
[source, js]
5+
----
6+
const response = await client.search({
7+
index: "cooking_blog",
8+
query: {
9+
bool: {
10+
must: [
11+
{
12+
term: {
13+
"category.keyword": "Main Course",
14+
},
15+
},
16+
{
17+
term: {
18+
tags: "vegetarian",
19+
},
20+
},
21+
{
22+
range: {
23+
rating: {
24+
gte: 4.5,
25+
},
26+
},
27+
},
28+
],
29+
should: [
30+
{
31+
multi_match: {
32+
query: "curry spicy",
33+
fields: ["title^2", "description"],
34+
},
35+
},
36+
{
37+
range: {
38+
date: {
39+
gte: "now-1M/d",
40+
},
41+
},
42+
},
43+
],
44+
must_not: [
45+
{
46+
term: {
47+
"category.keyword": "Dessert",
48+
},
49+
},
50+
],
51+
},
52+
},
53+
});
54+
console.log(response);
55+
----

docs/doc_examples/5f16358ebb5d14b86f57612d5f92d923.asciidoc renamed to docs/doc_examples/19f1f9f25933f8e7aba59a10881c648b.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const response = await client.indices.create({
99
properties: {
1010
inference_field: {
1111
type: "semantic_text",
12+
inference_id: "my-elser-endpoint",
1213
},
1314
},
1415
},
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// This file is autogenerated, DO NOT EDIT
2+
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
3+
4+
[source, js]
5+
----
6+
const response = await client.index({
7+
index: "my-index-000001",
8+
id: 1,
9+
refresh: "true",
10+
document: {
11+
text: "quick brown fox",
12+
},
13+
});
14+
console.log(response);
15+
16+
const response1 = await client.index({
17+
index: "my-index-000001",
18+
id: 2,
19+
refresh: "true",
20+
document: {
21+
text: "quick fox",
22+
},
23+
});
24+
console.log(response1);
25+
26+
const response2 = await client.search({
27+
index: "my-index-000001",
28+
query: {
29+
script_score: {
30+
query: {
31+
match: {
32+
text: "quick brown fox",
33+
},
34+
},
35+
script: {
36+
source: "_termStats.termFreq().getAverage()",
37+
},
38+
},
39+
},
40+
});
41+
console.log(response2);
42+
----
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// This file is autogenerated, DO NOT EDIT
2+
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
3+
4+
[source, js]
5+
----
6+
const response = await client.search({
7+
index: "cooking_blog",
8+
query: {
9+
range: {
10+
date: {
11+
gte: "2023-05-01",
12+
lte: "2023-05-31",
13+
},
14+
},
15+
},
16+
});
17+
console.log(response);
18+
----

docs/doc_examples/7a2fdfd7b0553d63440af7598f9ad867.asciidoc renamed to docs/doc_examples/58f6b72009512851843c7b7a20e9504a.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[source, js]
55
----
66
const response = await client.indices.create({
7-
index: "my-index-000003",
7+
index: "my-index-000002",
88
mappings: {
99
properties: {
1010
inference_field: {
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// This file is autogenerated, DO NOT EDIT
2+
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
3+
4+
[source, js]
5+
----
6+
const response = await client.search({
7+
index: "cooking_blog",
8+
query: {
9+
match: {
10+
description: {
11+
query: "fluffy pancakes",
12+
operator: "and",
13+
},
14+
},
15+
},
16+
});
17+
console.log(response);
18+
----

docs/doc_examples/7a32f44a1511ecb0d3f0b0ff2aca5c44.asciidoc

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// This file is autogenerated, DO NOT EDIT
2+
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
3+
4+
[source, js]
5+
----
6+
const response = await client.search({
7+
index: "cooking_blog",
8+
query: {
9+
match: {
10+
description: {
11+
query: "fluffy pancakes",
12+
},
13+
},
14+
},
15+
});
16+
console.log(response);
17+
----

docs/doc_examples/2f67db5e4d6c958258c3d70fb2d0b1c8.asciidoc renamed to docs/doc_examples/84ef9fe951c6d3caa7438238a5b23319.asciidoc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33

44
[source, js]
55
----
6-
const response = await client.indices.putSettings({
7-
index: "my-index-000001",
8-
settings: {
9-
"index.merge.policy.max_merge_at_once_explicit": null,
6+
const response = await client.search({
7+
index: "cooking_blog",
8+
query: {
9+
term: {
10+
"author.keyword": "Maria Rodriguez",
11+
},
1012
},
1113
});
1214
console.log(response);
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// This file is autogenerated, DO NOT EDIT
2+
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
3+
4+
[source, js]
5+
----
6+
const response = await client.indices.putMapping({
7+
index: "cooking_blog",
8+
properties: {
9+
title: {
10+
type: "text",
11+
analyzer: "standard",
12+
fields: {
13+
keyword: {
14+
type: "keyword",
15+
ignore_above: 256,
16+
},
17+
},
18+
},
19+
description: {
20+
type: "text",
21+
fields: {
22+
keyword: {
23+
type: "keyword",
24+
},
25+
},
26+
},
27+
author: {
28+
type: "text",
29+
fields: {
30+
keyword: {
31+
type: "keyword",
32+
},
33+
},
34+
},
35+
date: {
36+
type: "date",
37+
format: "yyyy-MM-dd",
38+
},
39+
category: {
40+
type: "text",
41+
fields: {
42+
keyword: {
43+
type: "keyword",
44+
},
45+
},
46+
},
47+
tags: {
48+
type: "text",
49+
fields: {
50+
keyword: {
51+
type: "keyword",
52+
},
53+
},
54+
},
55+
rating: {
56+
type: "float",
57+
},
58+
},
59+
});
60+
console.log(response);
61+
----

docs/doc_examples/96e88611f99e6834bd64b58dc8a282c1.asciidoc

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// This file is autogenerated, DO NOT EDIT
2+
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
3+
4+
[source, js]
5+
----
6+
const response = await client.search({
7+
index: "cooking_blog",
8+
query: {
9+
bool: {
10+
filter: [
11+
{
12+
term: {
13+
"category.keyword": "Breakfast",
14+
},
15+
},
16+
],
17+
},
18+
},
19+
});
20+
console.log(response);
21+
----
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This file is autogenerated, DO NOT EDIT
2+
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
3+
4+
[source, js]
5+
----
6+
const response = await client.search({
7+
index: "cooking_blog",
8+
query: {
9+
multi_match: {
10+
query: "vegetarian curry",
11+
fields: ["title^3", "description^2", "tags"],
12+
},
13+
},
14+
});
15+
console.log(response);
16+
----

0 commit comments

Comments
 (0)