-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsplit.yml
88 lines (83 loc) · 1.96 KB
/
split.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
requires:
serverless: false
stack: true
---
setup:
- do:
indices.create:
index: split_index_source
wait_for_active_shards: 1
body:
settings:
index.number_of_shards: 2
index.number_of_replicas: 0
index.number_of_routing_shards: 4
- do:
index:
index: split_index_source
id: "1"
body: { "foo": "hello world" }
- do:
index:
index: split_index_source
id: "2"
body: { "foo": "hello world 2" }
- do:
index:
index: split_index_source
id: "3"
body: { "foo": "hello world 3" }
---
teardown:
- do:
indices.delete:
index: split_index_source
- do:
indices.delete:
index: split_index_target
---
"Split index via API":
# make it read-only
- do:
indices.put_settings:
index: split_index_source
body:
index.blocks.write: true
index.number_of_replicas: 0
# now we do the actual split
- do:
indices.split:
index: "split_index_source"
target: "split_index_target"
wait_for_active_shards: 1
master_timeout: 10s
body:
settings:
index.number_of_replicas: 0
index.number_of_shards: 4
- do:
get:
index: split_index_target
id: "1"
- match: { _index: split_index_target }
- match: { _id: "1" }
- match: { _source: { foo: "hello world" } }
- do:
get:
index: split_index_target
id: "2"
- match: { _index: split_index_target }
- match: { _id: "2" }
- match: { _source: { foo: "hello world 2" } }
- do:
get:
index: split_index_target
id: "3"
- match: { _index: split_index_target }
- match: { _id: "3" }
- match: { _source: { foo: "hello world 3" } }
- do:
search:
index: split_index_target
- match: { hits.total.value: 3 }