Skip to content

Commit 2fc7025

Browse files
committed
restore first reindex example, regen
1 parent 93355bd commit 2fc7025

File tree

4 files changed

+132
-0
lines changed

4 files changed

+132
-0
lines changed

output/openapi/elasticsearch-openapi.json

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/openapi/elasticsearch-serverless-openapi.json

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/schema.json

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
summary: Reindex multiple sources
2+
method_request: POST _reindex
3+
description: >
4+
Run `POST _reindex` to reindex from multiple sources. The `index` attribute in source can be a list, which enables you to copy
5+
from lots of sources in one request. This example copies documents from the `my-index-000001` and `my-index-000002` indices.
6+
# type: request
7+
value: |-
8+
{
9+
"source": {
10+
"index": ["my-index-000001", "my-index-000002"]
11+
},
12+
"dest": {
13+
"index": "my-new-index-000002"
14+
}
15+
}
16+
alternatives:
17+
- language: Python
18+
code: |-
19+
resp = client.reindex(
20+
source={
21+
"index": [
22+
"my-index-000001",
23+
"my-index-000002"
24+
]
25+
},
26+
dest={
27+
"index": "my-new-index-000002"
28+
},
29+
)
30+
- language: JavaScript
31+
code: |-
32+
const response = await client.reindex({
33+
source: {
34+
index: ["my-index-000001", "my-index-000002"],
35+
},
36+
dest: {
37+
index: "my-new-index-000002",
38+
},
39+
});
40+
- language: Ruby
41+
code: |-
42+
response = client.reindex(
43+
body: {
44+
"source": {
45+
"index": [
46+
"my-index-000001",
47+
"my-index-000002"
48+
]
49+
},
50+
"dest": {
51+
"index": "my-new-index-000002"
52+
}
53+
}
54+
)
55+
- language: PHP
56+
code: |-
57+
$resp = $client->reindex([
58+
"body" => [
59+
"source" => [
60+
"index" => array(
61+
"my-index-000001",
62+
"my-index-000002",
63+
),
64+
],
65+
"dest" => [
66+
"index" => "my-new-index-000002",
67+
],
68+
],
69+
]);
70+
- language: curl
71+
code:
72+
'curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d
73+
''{"source":{"index":["my-index-000001","my-index-000002"]},"dest":{"index":"my-new-index-000002"}}''
74+
"$ELASTICSEARCH_URL/_reindex"'
75+
- language: Java
76+
code: |
77+
client.reindex(r -> r
78+
.dest(d -> d
79+
.index("my-new-index-000002")
80+
)
81+
.source(s -> s
82+
.index(List.of("my-index-000001","my-index-000002"))
83+
)
84+
);

0 commit comments

Comments
 (0)