Skip to content

Commit 3993aa9

Browse files
committed
Create typeless versions of the REST tests for exists and mget.
1 parent bd8e407 commit 3993aa9

30 files changed

+895
-84
lines changed

rest-api-spec/src/main/resources/rest-api-spec/api/exists.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
},
1919
"type": {
2020
"type" : "string",
21-
"required" : true,
2221
"description" : "The type of the document (use `_all` to fetch the first document matching the ID across all types)"
2322
}
2423
},

rest-api-spec/src/main/resources/rest-api-spec/test/exists/10_basic.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
---
22
"Basic":
3+
- skip:
4+
version: " - 6.99.99"
5+
reason: types are required in requests before 7.0.0
36

47
- do:
58
exists:
69
index: test_1
7-
type: test
810
id: 1
911

1012
- is_false: ''
1113

1214
- do:
1315
index:
1416
index: test_1
15-
type: test
17+
type: _doc
1618
id: 1
1719
body: { "foo": "bar" }
1820

@@ -21,15 +23,13 @@
2123
- do:
2224
exists:
2325
index: test_1
24-
type: test
2526
id: 1
2627

2728
- is_true: ''
2829

2930
- do:
3031
exists:
3132
index: test_1
32-
type: test
3333
id: 1
3434
version: 1
3535

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
"Basic":
3+
4+
- do:
5+
exists:
6+
index: test_1
7+
type: test
8+
id: 1
9+
10+
- is_false: ''
11+
12+
- do:
13+
index:
14+
index: test_1
15+
type: test
16+
id: 1
17+
body: { "foo": "bar" }
18+
19+
- is_true: ''
20+
21+
- do:
22+
exists:
23+
index: test_1
24+
type: test
25+
id: 1
26+
27+
- is_true: ''
28+
29+
- do:
30+
exists:
31+
index: test_1
32+
type: test
33+
id: 1
34+
version: 1
35+
36+
- is_true: ''

rest-api-spec/src/main/resources/rest-api-spec/test/exists/40_routing.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22
"Routing":
3+
- skip:
4+
version: " - 6.99.99"
5+
reason: types are required in requests before 7.0.0
36

47
- do:
58
indices.create:
@@ -18,15 +21,14 @@
1821
- do:
1922
index:
2023
index: test_1
21-
type: test
24+
type: _doc
2225
id: 1
2326
routing: 5
2427
body: { foo: bar }
2528

2629
- do:
2730
exists:
2831
index: test_1
29-
type: test
3032
id: 1
3133
routing: 5
3234

@@ -35,7 +37,6 @@
3537
- do:
3638
exists:
3739
index: test_1
38-
type: test
3940
id: 1
4041

4142
- is_false: ''
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
"Routing":
3+
4+
- do:
5+
indices.create:
6+
index: test_1
7+
body:
8+
settings:
9+
index:
10+
number_of_shards: 5
11+
number_of_routing_shards: 5
12+
number_of_replicas: 0
13+
14+
- do:
15+
cluster.health:
16+
wait_for_status: green
17+
18+
- do:
19+
index:
20+
index: test_1
21+
type: test
22+
id: 1
23+
routing: 5
24+
body: { foo: bar }
25+
26+
- do:
27+
exists:
28+
index: test_1
29+
type: test
30+
id: 1
31+
routing: 5
32+
33+
- is_true: ''
34+
35+
- do:
36+
exists:
37+
index: test_1
38+
type: test
39+
id: 1
40+
41+
- is_false: ''

rest-api-spec/src/main/resources/rest-api-spec/test/exists/60_realtime_refresh.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22
"Realtime Refresh":
3+
- skip:
4+
version: " - 6.99.99"
5+
reason: types are required in requests before 7.0.0
36

47
- do:
58
indices.create:
@@ -17,14 +20,13 @@
1720
- do:
1821
index:
1922
index: test_1
20-
type: test
23+
type: _doc
2124
id: 1
2225
body: { foo: bar }
2326

2427
- do:
2528
exists:
2629
index: test_1
27-
type: test
2830
id: 1
2931
realtime: false
3032

@@ -33,7 +35,6 @@
3335
- do:
3436
exists:
3537
index: test_1
36-
type: test
3738
id: 1
3839
realtime: true
3940

@@ -42,7 +43,6 @@
4243
- do:
4344
exists:
4445
index: test_1
45-
type: test
4646
id: 1
4747
realtime: false
4848
refresh: true
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
"Realtime Refresh":
3+
4+
- do:
5+
indices.create:
6+
index: test_1
7+
body:
8+
settings:
9+
index:
10+
refresh_interval: -1
11+
number_of_replicas: 0
12+
13+
- do:
14+
cluster.health:
15+
wait_for_status: green
16+
17+
- do:
18+
index:
19+
index: test_1
20+
type: test
21+
id: 1
22+
body: { foo: bar }
23+
24+
- do:
25+
exists:
26+
index: test_1
27+
type: test
28+
id: 1
29+
realtime: false
30+
31+
- is_false: ''
32+
33+
- do:
34+
exists:
35+
index: test_1
36+
type: test
37+
id: 1
38+
realtime: true
39+
40+
- is_true: ''
41+
42+
- do:
43+
exists:
44+
index: test_1
45+
type: test
46+
id: 1
47+
realtime: false
48+
refresh: true
49+
50+
- is_true: ''
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
---
22
"Client-side default type":
3+
- skip:
4+
version: " - 6.99.99"
5+
reason: types are required in requests before 7.0.0
36

47
- do:
58
index:
69
index: test_1
7-
type: test
10+
type: _doc
811
id: 1
912
body: { "foo": "bar" }
1013

1114
- do:
1215
exists:
1316
index: test_1
14-
type: _all
1517
id: 1
1618

1719
- is_true: ''
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
"Client-side default type":
3+
4+
- do:
5+
index:
6+
index: test_1
7+
type: test
8+
id: 1
9+
body: { "foo": "bar" }
10+
11+
- do:
12+
exists:
13+
index: test_1
14+
type: _all
15+
id: 1
16+
17+
- is_true: ''
Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
---
22
"Basic multi-get":
3+
- skip:
4+
version: " - 6.99.99"
5+
reason: types are required in requests before 7.0.0
6+
37
- do:
48
indices.create:
59
index: test_2
610
- do:
711
index:
812
index: test_1
9-
type: test
13+
type: _doc
1014
id: 1
1115
body: { foo: bar }
1216

@@ -17,29 +21,23 @@
1721
mget:
1822
body:
1923
docs:
20-
- { _index: test_2, _type: test, _id: 1}
21-
- { _index: test_1, _type: none, _id: 1}
22-
- { _index: test_1, _type: test, _id: 2}
23-
- { _index: test_1, _type: test, _id: 1}
24+
- { _index: test_2, _id: 1}
25+
- { _index: test_1, _id: 2}
26+
- { _index: test_1, _id: 1}
2427

2528
- is_false: docs.0.found
2629
- match: { docs.0._index: test_2 }
27-
- match: { docs.0._type: test }
30+
- match: { docs.0._type: null }
2831
- match: { docs.0._id: "1" }
2932

3033
- is_false: docs.1.found
3134
- match: { docs.1._index: test_1 }
32-
- match: { docs.1._type: none }
33-
- match: { docs.1._id: "1" }
35+
- match: { docs.1._type: _doc }
36+
- match: { docs.1._id: "2" }
3437

35-
- is_false: docs.2.found
38+
- is_true: docs.2.found
3639
- match: { docs.2._index: test_1 }
37-
- match: { docs.2._type: test }
38-
- match: { docs.2._id: "2" }
39-
40-
- is_true: docs.3.found
41-
- match: { docs.3._index: test_1 }
42-
- match: { docs.3._type: test }
43-
- match: { docs.3._id: "1" }
44-
- match: { docs.3._version: 1 }
45-
- match: { docs.3._source: { foo: bar }}
40+
- match: { docs.2._type: _doc }
41+
- match: { docs.2._id: "1" }
42+
- match: { docs.2._version: 1 }
43+
- match: { docs.2._source: { foo: bar }}

0 commit comments

Comments
 (0)