Skip to content

Commit 07f75a4

Browse files
Auto-generated API code (#2596)
1 parent 4e6cbf9 commit 07f75a4

File tree

52 files changed

+936
-195
lines changed

Some content is hidden

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

52 files changed

+936
-195
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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.getDataStream({
7+
name: "my-data-stream",
8+
filter_path: "data_streams.indices.index_name",
9+
});
10+
console.log(response);
11+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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.putSettings({
7+
index: ".reindexed-v9-ml-anomalies-custom-example",
8+
settings: {
9+
index: {
10+
number_of_replicas: "<original_number_of_replicas>",
11+
},
12+
},
13+
});
14+
console.log(response);
15+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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.addBlock({
7+
index: ".ml-anomalies-custom-example",
8+
block: "read_only",
9+
});
10+
console.log(response);
11+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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.security.queryRole({
7+
query: {
8+
bool: {
9+
must_not: {
10+
term: {
11+
"metadata._reserved": true,
12+
},
13+
},
14+
},
15+
},
16+
sort: ["name"],
17+
});
18+
console.log(response);
19+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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.addBlock({
7+
index: ".ml-anomalies-custom-example",
8+
block: "write",
9+
});
10+
console.log(response);
11+
----

Diff for: docs/doc_examples/d29031409016b2b798148ef173a196ae.asciidoc renamed to docs/doc_examples/2afd49985950cbcccf727fa858d00067.asciidoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
const response = await client.indices.create({
77
index: "test-index",
88
query: {
9-
semantic: {
10-
field: "my_semantic_field",
9+
match: {
10+
my_field: "Which country is Paris in?",
1111
},
1212
},
1313
highlight: {
1414
fields: {
15-
my_semantic_field: {
15+
my_field: {
1616
type: "semantic",
1717
number_of_fragments: 2,
1818
order: "score",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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: "my-index-*",
8+
query: {
9+
bool: {
10+
must: [
11+
{
12+
match: {
13+
"user.id": "kimchy",
14+
},
15+
},
16+
],
17+
must_not: [
18+
{
19+
terms: {
20+
_index: ["my-index-01"],
21+
},
22+
},
23+
],
24+
},
25+
},
26+
});
27+
console.log(response);
28+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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.ilm.putLifecycle({
7+
name: "my_policy",
8+
policy: {
9+
phases: {
10+
hot: {
11+
actions: {
12+
rollover: {
13+
max_primary_shard_size: "50gb",
14+
},
15+
searchable_snapshot: {
16+
snapshot_repository: "backing_repo",
17+
replicate_for: "14d",
18+
},
19+
},
20+
},
21+
delete: {
22+
min_age: "28d",
23+
actions: {
24+
delete: {},
25+
},
26+
},
27+
},
28+
},
29+
});
30+
console.log(response);
31+
----

Diff for: docs/doc_examples/37f367ca81a16d3aef4ef7126ec33a2e.asciidoc renamed to docs/doc_examples/36792c81c053e0555407d1e83e7e054f.asciidoc

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ const response = await client.search({
99
retriever: {
1010
rescorer: {
1111
rescore: {
12+
window_size: 50,
1213
query: {
13-
window_size: 50,
1414
rescore_query: {
1515
script_score: {
16+
query: {
17+
match_all: {},
18+
},
1619
script: {
1720
source:
1821
"cosineSimilarity(params.queryVector, 'product-vector_final_stage') + 1.0",
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.indices.create({
7+
index: "my-index",
8+
settings: {
9+
index: {
10+
number_of_shards: 3,
11+
"blocks.write": true,
12+
},
13+
},
14+
mappings: {
15+
properties: {
16+
field1: {
17+
type: "text",
18+
},
19+
},
20+
},
21+
});
22+
console.log(response);
23+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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: ".ml-anomalies-custom-example",
8+
size: 0,
9+
aggs: {
10+
job_ids: {
11+
terms: {
12+
field: "job_id",
13+
size: 100,
14+
},
15+
},
16+
},
17+
});
18+
console.log(response);
19+
----
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.search({
7+
index: "retrievers_example",
8+
retriever: {
9+
linear: {
10+
retrievers: [
11+
{
12+
retriever: {
13+
standard: {
14+
query: {
15+
function_score: {
16+
query: {
17+
term: {
18+
topic: "ai",
19+
},
20+
},
21+
functions: [
22+
{
23+
script_score: {
24+
script: {
25+
source: "doc['timestamp'].value.millis",
26+
},
27+
},
28+
},
29+
],
30+
boost_mode: "replace",
31+
},
32+
},
33+
sort: {
34+
timestamp: {
35+
order: "asc",
36+
},
37+
},
38+
},
39+
},
40+
weight: 2,
41+
normalizer: "minmax",
42+
},
43+
{
44+
retriever: {
45+
knn: {
46+
field: "vector",
47+
query_vector: [0.23, 0.67, 0.89],
48+
k: 3,
49+
num_candidates: 5,
50+
},
51+
},
52+
weight: 1.5,
53+
},
54+
],
55+
rank_window_size: 10,
56+
},
57+
},
58+
_source: false,
59+
});
60+
console.log(response);
61+
----
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.inference.put({
7+
task_type: "sparse_embedding",
8+
inference_id: "elser-model-eis",
9+
inference_config: {
10+
service: "elastic",
11+
service_settings: {
12+
model_name: "elser",
13+
},
14+
},
15+
});
16+
console.log(response);
17+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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.cluster.putSettings({
7+
persistent: {
8+
"migrate.data_stream_reindex_max_request_per_second": 10000,
9+
},
10+
});
11+
console.log(response);
12+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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.getSettings({
7+
index: ".reindexed-v9-ml-anomalies-custom-example",
8+
});
9+
console.log(response);
10+
----
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.search({
7+
index: "test-index",
8+
query: {
9+
match: {
10+
my_semantic_field: "Which country is Paris in?",
11+
},
12+
},
13+
highlight: {
14+
fields: {
15+
my_semantic_field: {
16+
number_of_fragments: 2,
17+
order: "score",
18+
},
19+
},
20+
},
21+
});
22+
console.log(response);
23+
----
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.reindex({
7+
wait_for_completion: "false",
8+
source: {
9+
index: ".ml-anomalies-custom-example",
10+
},
11+
dest: {
12+
index: ".reindexed-v9-ml-anomalies-custom-example",
13+
},
14+
});
15+
console.log(response);
16+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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.putSettings({
7+
index: ".reindexed-v9-ml-anomalies-custom-example",
8+
settings: {
9+
index: {
10+
number_of_replicas: 0,
11+
},
12+
},
13+
});
14+
console.log(response);
15+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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.esql.query({
7+
query:
8+
'\nFROM library\n| EVAL year = DATE_EXTRACT("year", release_date)\n| WHERE page_count > ? AND match(author, ?, {"minimum_should_match": ?})\n| LIMIT 5\n',
9+
params: [300, "Frank Herbert", 2],
10+
});
11+
console.log(response);
12+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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.getAlias({
7+
index: ".ml-anomalies-custom-example",
8+
});
9+
console.log(response);
10+
----

0 commit comments

Comments
 (0)