Skip to content

Commit 75b7b07

Browse files
Auto-generated code for 8.17 (#2503)
1 parent cc9d856 commit 75b7b07

File tree

118 files changed

+1661
-820
lines changed

Some content is hidden

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

118 files changed

+1661
-820
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+
----
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/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/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/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/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",

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const response = await client.indices.create({
99
properties: {
1010
inference_field: {
1111
type: "semantic_text",
12-
inference_id: "my-elser-endpoint",
1312
},
1413
},
1514
},

docs/doc_examples/2fd458d37aab509fe2d970c0b6e2a10f.asciidoc renamed to docs/doc_examples/68d7f7d4d268ee98caead5aef19933d6.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ console.log(response);
4545
4646
const response1 = await client.indices.putIndexTemplate({
4747
name: 2,
48-
index_patterns: ["k8s*"],
48+
index_patterns: ["k9s*"],
4949
composed_of: ["destination_template"],
5050
data_stream: {},
5151
});
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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+
knn: {
13+
field: "vector",
14+
query_vector: [0.23, 0.67, 0.89],
15+
k: 3,
16+
num_candidates: 5,
17+
},
18+
},
19+
{
20+
text_similarity_reranker: {
21+
retriever: {
22+
standard: {
23+
query: {
24+
term: {
25+
topic: "ai",
26+
},
27+
},
28+
},
29+
},
30+
field: "text",
31+
inference_id: "my-rerank-model",
32+
inference_text:
33+
"Can I use generative AI to identify user intent and improve search relevance?",
34+
},
35+
},
36+
],
37+
rank_window_size: 10,
38+
rank_constant: 1,
39+
},
40+
},
41+
_source: false,
42+
});
43+
console.log(response);
44+
----
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+
text_similarity_reranker: {
10+
retriever: {
11+
rrf: {
12+
retrievers: [
13+
{
14+
standard: {
15+
query: {
16+
query_string: {
17+
query:
18+
"(information retrieval) OR (artificial intelligence)",
19+
default_field: "text",
20+
},
21+
},
22+
},
23+
},
24+
{
25+
knn: {
26+
field: "vector",
27+
query_vector: [0.23, 0.67, 0.89],
28+
k: 3,
29+
num_candidates: 5,
30+
},
31+
},
32+
],
33+
rank_window_size: 10,
34+
rank_constant: 1,
35+
},
36+
},
37+
field: "text",
38+
inference_id: "my-rerank-model",
39+
inference_text:
40+
"What are the state of the art applications of AI in information retrieval?",
41+
},
42+
},
43+
_source: false,
44+
});
45+
console.log(response);
46+
----

0 commit comments

Comments
 (0)