/
70_mix_typeless_typeful.yml
92 lines (79 loc) · 2.17 KB
/
70_mix_typeless_typeful.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
89
90
91
92
---
"Index with typeless API on an index that has types":
- do:
indices.create: # not using include_type_name: false on purpose
include_type_name: true
index: index
body:
mappings:
not_doc:
properties:
foo:
type: "keyword"
- do:
index:
index: index
id: 1
body: { foo: bar }
- match: { _index: "index" }
- match: { _type: "_doc" }
- match: { _id: "1"}
- match: { _version: 1}
- do:
get: # not using typeless API on purpose
index: index
type: not_doc
id: 1
- match: { _index: "index" }
- match: { _type: "not_doc" } # the important bit to check
- match: { _id: "1"}
- match: { _version: 1}
- match: { _source: { foo: bar }}
- do:
index:
index: index
body: { foo: bar }
- match: { _index: "index" }
- match: { _type: "_doc" }
- match: { _version: 1}
- set: { _id: id }
- do:
get: # using typeful API on purpose
index: index
type: not_doc
id: '$id'
- match: { _index: "index" }
- match: { _type: "not_doc" } # the important bit to check
- match: { _id: $id}
- match: { _version: 1}
- match: { _source: { foo: bar }}
---
"Index call that introduces new field mappings":
- do:
indices.create: # not using include_type_name: false on purpose
include_type_name: true
index: index
body:
mappings:
not_doc:
properties:
foo:
type: "keyword"
- do:
index:
index: index
id: 2
body: { new_field: value }
- match: { _index: "index" }
- match: { _type: "_doc" }
- match: { _id: "2" }
- match: { _version: 1 }
- do:
get: # using typeful API on purpose
index: index
type: not_doc
id: 2
- match: { _index: "index" }
- match: { _type: "not_doc" }
- match: { _id: "2" }
- match: { _version: 1}