Skip to content

Commit 419271d

Browse files
Auto-generated code for 8.16 (#2502)
1 parent 1ef1754 commit 419271d

File tree

63 files changed

+1080
-126
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1080
-126
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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: "retrievers_example",
8+
retriever: {
9+
rrf: {
10+
retrievers: [
11+
{
12+
standard: {
13+
query: {
14+
range: {
15+
year: {
16+
gt: 2023,
17+
},
18+
},
19+
},
20+
},
21+
},
22+
{
23+
standard: {
24+
query: {
25+
term: {
26+
topic: "elastic",
27+
},
28+
},
29+
},
30+
},
31+
],
32+
rank_window_size: 10,
33+
rank_constant: 1,
34+
},
35+
},
36+
_source: false,
37+
aggs: {
38+
topics: {
39+
terms: {
40+
field: "topic",
41+
},
42+
},
43+
},
44+
});
45+
console.log(response);
46+
----
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.inference.put({
7+
task_type: "rerank",
8+
inference_id: "my-rerank-model",
9+
inference_config: {
10+
service: "cohere",
11+
service_settings: {
12+
model_id: "rerank-english-v3.0",
13+
api_key: "{{COHERE_API_KEY}}",
14+
},
15+
},
16+
});
17+
console.log(response);
18+
----
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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: "retrievers_example_nested",
8+
retriever: {
9+
rrf: {
10+
retrievers: [
11+
{
12+
standard: {
13+
query: {
14+
nested: {
15+
path: "nested_field",
16+
inner_hits: {
17+
name: "nested_vector",
18+
_source: false,
19+
fields: ["nested_field.paragraph_id"],
20+
},
21+
query: {
22+
knn: {
23+
field: "nested_field.nested_vector",
24+
query_vector: [1, 0, 0.5],
25+
k: 10,
26+
},
27+
},
28+
},
29+
},
30+
},
31+
},
32+
{
33+
standard: {
34+
query: {
35+
term: {
36+
topic: "ai",
37+
},
38+
},
39+
},
40+
},
41+
],
42+
rank_window_size: 10,
43+
rank_constant: 1,
44+
},
45+
},
46+
_source: ["topic"],
47+
});
48+
console.log(response);
49+
----

docs/doc_examples/0bee07a581c5776e068f6f4efad5a399.asciidoc

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

44
[source, js]
55
----
6-
const response = await client.esql.asyncQuery({
7-
format: "json",
6+
const response = await client.transport.request({
7+
method: "POST",
8+
path: "/_query/async",
9+
querystring: {
10+
format: "json",
11+
},
812
body: {
913
query:
1014
"\n FROM my-index-000001,cluster_one:my-index-000001,cluster_two:my-index*\n | STATS COUNT(http.response.status_code) BY user.id\n | LIMIT 2\n ",
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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: "retrievers_example",
8+
retriever: {
9+
rrf: {
10+
retrievers: [
11+
{
12+
standard: {
13+
query: {
14+
term: {
15+
topic: "elastic",
16+
},
17+
},
18+
},
19+
},
20+
{
21+
rrf: {
22+
retrievers: [
23+
{
24+
standard: {
25+
query: {
26+
query_string: {
27+
query:
28+
"(information retrieval) OR (artificial intelligence)",
29+
default_field: "text",
30+
},
31+
},
32+
},
33+
},
34+
{
35+
knn: {
36+
field: "vector",
37+
query_vector: [0.23, 0.67, 0.89],
38+
k: 3,
39+
num_candidates: 5,
40+
},
41+
},
42+
],
43+
rank_window_size: 10,
44+
rank_constant: 1,
45+
},
46+
},
47+
],
48+
rank_window_size: 10,
49+
rank_constant: 1,
50+
},
51+
},
52+
_source: false,
53+
size: 1,
54+
explain: true,
55+
});
56+
console.log(response);
57+
----

docs/doc_examples/0dfde6a9d953822fd4b3aa0121ddd8fb.asciidoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33

44
[source, js]
55
----
6-
const response = await client.searchApplication.renderQuery({
7-
name: "my-app",
6+
const response = await client.transport.request({
7+
method: "POST",
8+
path: "/_application/search_application/my-app/_render_query",
89
body: {
910
params: {
1011
query_string: "my first query",

docs/doc_examples/16634cfa7916cf4e8048a1d70e6240f2.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const response = await client.searchApplication.put({
1111
script: {
1212
lang: "mustache",
1313
source:
14-
'\n {\n "query": {\n "bool": {\n "must": [\n {{#query}}\n \n {{/query}}\n ],\n "filter": {{#toJson}}_es_filters{{/toJson}}\n }\n },\n "_source": {\n "includes": ["title", "plot"]\n },\n "highlight": {\n "fields": {\n "title": { "fragment_size": 0 },\n "plot": { "fragment_size": 200 }\n }\n },\n "aggs": {{#toJson}}_es_aggs{{/toJson}},\n "from": {{from}},\n "size": {{size}},\n "sort": {{#toJson}}_es_sort_fields{{/toJson}}\n }\n ',
14+
'\n {\n "query": {\n "bool": {\n "must": [\n {{#query}}\n {{/query}}\n ],\n "filter": {{#toJson}}_es_filters{{/toJson}}\n }\n },\n "_source": {\n "includes": ["title", "plot"]\n },\n "highlight": {\n "fields": {\n "title": { "fragment_size": 0 },\n "plot": { "fragment_size": 200 }\n }\n },\n "aggs": {{#toJson}}_es_aggs{{/toJson}},\n "from": {{from}},\n "size": {{size}},\n "sort": {{#toJson}}_es_sort_fields{{/toJson}}\n }\n ',
1515
params: {
1616
query: "",
1717
_es_filters: {},

docs/doc_examples/c02c2916b97b6fa7db82dbc7f0378310.asciidoc renamed to docs/doc_examples/17b1647c8509543f2388c886f2584a20.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const response = await client.search({
1616
},
1717
},
1818
field: "text",
19-
inference_id: "my-cohere-rerank-model",
19+
inference_id: "elastic-rerank",
2020
inference_text: "How often does the moon hide the sun?",
2121
rank_window_size: 100,
2222
min_score: 0.5,

docs/doc_examples/19c00c6b29bc7dbc5e92b3668da2da93.asciidoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33

44
[source, js]
55
----
6-
const response = await client.simulate.ingest({
6+
const response = await client.transport.request({
7+
method: "POST",
8+
path: "/_ingest/_simulate",
79
body: {
810
docs: [
911
{

docs/doc_examples/4dab4c5168047ba596af1beb0e55b845.asciidoc renamed to docs/doc_examples/22b176a184517cf1b5801f5eb4f17f97.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
[source, js]
55
----
6-
const response = await client.cluster.getSettings({
7-
flat_settings: "true",
6+
const response = await client.indices.rollover({
7+
alias: "datastream",
88
});
99
console.log(response);
1010
----

docs/doc_examples/2577acb462b95bd4394523cf2f8a661f.asciidoc

Lines changed: 0 additions & 28 deletions
This file was deleted.

docs/doc_examples/2a1eece9a59ac1773edcf0a932c26de0.asciidoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33

44
[source, js]
55
----
6-
const response = await client.security.oidcLogout({
6+
const response = await client.transport.request({
7+
method: "POST",
8+
path: "/_security/oidc/logout",
79
body: {
810
token:
911
"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==",

docs/doc_examples/2afdf0d83724953aa2875b5fb37d60cc.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.esql.asyncQueryGet({
7-
id: "FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=",
8-
wait_for_completion_timeout: "30s",
9-
body: null,
6+
const response = await client.transport.request({
7+
method: "GET",
8+
path: "/_query/async/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=",
9+
querystring: {
10+
wait_for_completion_timeout: "30s",
11+
},
1012
});
1113
console.log(response);
1214
----

docs/doc_examples/2bb41b0b4876ce98cd0cd8fb6d337f18.asciidoc

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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.inference.put({
7+
task_type: "rerank",
8+
inference_id: "my-elastic-rerank",
9+
inference_config: {
10+
service: "elasticsearch",
11+
service_settings: {
12+
model_id: ".rerank-v1",
13+
num_threads: 1,
14+
adaptive_allocations: {
15+
enabled: true,
16+
min_number_of_allocations: 1,
17+
max_number_of_allocations: 4,
18+
},
19+
},
20+
},
21+
});
22+
console.log(response);
23+
----

docs/doc_examples/3f1fe5f5f99b98d0891f38003e10b636.asciidoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33

44
[source, js]
55
----
6-
const response = await client.esql.asyncQuery({
6+
const response = await client.transport.request({
7+
method: "POST",
8+
path: "/_query/async",
79
body: {
810
query:
911
"\n FROM library\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\n | STATS MAX(page_count) BY year\n | SORT year\n | LIMIT 5\n ",

docs/doc_examples/405511f7c1f12cc0a227b4563fe7b2e2.asciidoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
[source, js]
55
----
6-
const response = await client.esql.asyncQueryGet({
7-
id: "FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=",
8-
body: null,
6+
const response = await client.transport.request({
7+
method: "GET",
8+
path: "/_query/async/FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=",
99
});
1010
console.log(response);
1111
----

docs/doc_examples/4b91ad7c9b44e07db4a4e81390f19ad3.asciidoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
[source, js]
55
----
6-
const response = await client.inference.streamInference({
7-
task_type: "completion",
8-
inference_id: "openai-completion",
6+
const response = await client.transport.request({
7+
method: "POST",
8+
path: "/_inference/completion/openai-completion/_stream",
99
body: {
1010
input: "What is Elastic?",
1111
},

docs/doc_examples/191074b2eebd5f74e628c2ada4b6d2e4.asciidoc renamed to docs/doc_examples/4edfb5934d14ad7655bd7e19a112b5c0.asciidoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ const response = await client.search({
88
query: {
99
bool: {
1010
must: [
11-
{
12-
term: {
13-
"category.keyword": "Main Course",
14-
},
15-
},
1611
{
1712
term: {
1813
tags: "vegetarian",
@@ -27,6 +22,11 @@ const response = await client.search({
2722
},
2823
],
2924
should: [
25+
{
26+
term: {
27+
category: "Main Course",
28+
},
29+
},
3030
{
3131
multi_match: {
3232
query: "curry spicy",

0 commit comments

Comments
 (0)