@@ -23,50 +23,122 @@ setup:
23
23
type : string
24
24
index_name : t3
25
25
26
+ - do :
27
+ indices.create :
28
+ index : test_index_2
29
+ body :
30
+ mappings :
31
+ test_type_2 :
32
+ properties :
33
+ t1 :
34
+ type : string
35
+ t2 :
36
+ type : string
37
+ obj :
38
+ path : just_name
39
+ properties :
40
+ t1 :
41
+ type : string
42
+ i_t1 :
43
+ type : string
44
+ index_name : t1
45
+ i_t3 :
46
+ type : string
47
+ index_name : t3
48
+
26
49
---
27
50
" Get field mapping with * for fields " :
28
51
29
52
- do :
30
53
indices.get_field_mapping :
31
54
field : " *"
32
55
33
- - match : {test_index.test_type.t1.full_name: t1 }
34
- - match : {test_index.test_type.t2.full_name: t2 }
35
- - match : {test_index.test_type.obj\.t1.full_name: obj.t1 }
36
- - match : {test_index.test_type.obj\.i_t1.full_name: obj.i_t1 }
37
- - match : {test_index.test_type.obj\.i_t3.full_name: obj.i_t3 }
56
+ - match : {test_index.mappings. test_type.t1.full_name: t1 }
57
+ - match : {test_index.mappings. test_type.t2.full_name: t2 }
58
+ - match : {test_index.mappings. test_type.obj\.t1.full_name: obj.t1 }
59
+ - match : {test_index.mappings. test_type.obj\.i_t1.full_name: obj.i_t1 }
60
+ - match : {test_index.mappings. test_type.obj\.i_t3.full_name: obj.i_t3 }
38
61
39
62
---
40
63
" Get field mapping with t* for fields " :
41
64
42
65
- do :
43
66
indices.get_field_mapping :
67
+ index : test_index
44
68
field : " t*"
45
69
46
70
# i_t1 matches the pattern using it's index name, but t1 already means a full name
47
71
# of a field and thus takes precedence.
48
- - match : {test_index.test_type.t1.full_name: t1 }
49
- - match : {test_index.test_type.t2.full_name: t2 }
50
- - match : {test_index.test_type.t3.full_name: obj.i_t3 }
51
- - length : {test_index.test_type: 3}
72
+ - match : {test_index.mappings. test_type.t1.full_name: t1 }
73
+ - match : {test_index.mappings. test_type.t2.full_name: t2 }
74
+ - match : {test_index.mappings. test_type.t3.full_name: obj.i_t3 }
75
+ - length : {test_index.mappings. test_type: 3}
52
76
53
77
---
54
78
" Get field mapping with *t1 for fields " :
55
79
56
80
- do :
57
81
indices.get_field_mapping :
82
+ index : test_index
58
83
field : " *t1"
59
- - match : {test_index.test_type.t1.full_name: t1 }
60
- - match : {test_index.test_type.obj\.t1.full_name: obj.t1 }
61
- - match : {test_index.test_type.obj\.i_t1.full_name: obj.i_t1 }
62
- - length : {test_index.test_type: 3}
84
+ - match : {test_index.mappings. test_type.t1.full_name: t1 }
85
+ - match : {test_index.mappings. test_type.obj\.t1.full_name: obj.t1 }
86
+ - match : {test_index.mappings. test_type.obj\.i_t1.full_name: obj.i_t1 }
87
+ - length : {test_index.mappings. test_type: 3}
63
88
64
89
---
65
90
" Get field mapping with wildcarded relative names " :
66
91
67
92
- do :
68
93
indices.get_field_mapping :
94
+ index : test_index
95
+ field : " i_*"
96
+ - match : {test_index.mappings.test_type.i_t1.full_name: obj.i_t1 }
97
+ - match : {test_index.mappings.test_type.i_t3.full_name: obj.i_t3 }
98
+ - length : {test_index.mappings.test_type: 2}
99
+
100
+ ---
101
+ " Get field mapping should work using '_all' for indices and types " :
102
+
103
+ - do :
104
+ indices.get_field_mapping :
105
+ index : _all
106
+ type : _all
107
+ field : " i_*"
108
+ - match : {test_index.mappings.test_type.i_t1.full_name: obj.i_t1 }
109
+ - match : {test_index.mappings.test_type.i_t3.full_name: obj.i_t3 }
110
+ - length : {test_index.mappings.test_type: 2}
111
+ - match : {test_index_2.mappings.test_type_2.i_t1.full_name: obj.i_t1 }
112
+ - match : {test_index_2.mappings.test_type_2.i_t3.full_name: obj.i_t3 }
113
+ - length : {test_index_2.mappings.test_type_2: 2}
114
+
115
+ ---
116
+ " Get field mapping should work using '*' for indices and types " :
117
+
118
+ - do :
119
+ indices.get_field_mapping :
120
+ index : ' *'
121
+ type : ' *'
122
+ field : " i_*"
123
+ - match : {test_index.mappings.test_type.i_t1.full_name: obj.i_t1 }
124
+ - match : {test_index.mappings.test_type.i_t3.full_name: obj.i_t3 }
125
+ - length : {test_index.mappings.test_type: 2}
126
+ - match : {test_index_2.mappings.test_type_2.i_t1.full_name: obj.i_t1 }
127
+ - match : {test_index_2.mappings.test_type_2.i_t3.full_name: obj.i_t3 }
128
+ - length : {test_index_2.mappings.test_type_2: 2}
129
+
130
+ ---
131
+ " Get field mapping should work using comma_separated values for indices and types " :
132
+
133
+ - do :
134
+ indices.get_field_mapping :
135
+ index : ' test_index,test_index_2'
136
+ type : ' test_type,test_type_2'
69
137
field : " i_*"
70
- - match : {test_index.test_type.i_t1.full_name: obj.i_t1 }
71
- - match : {test_index.test_type.i_t3.full_name: obj.i_t3 }
72
- - length : {test_index.test_type: 2}
138
+ - match : {test_index.mappings.test_type.i_t1.full_name: obj.i_t1 }
139
+ - match : {test_index.mappings.test_type.i_t3.full_name: obj.i_t3 }
140
+ - length : {test_index.mappings.test_type: 2}
141
+ - match : {test_index_2.mappings.test_type_2.i_t1.full_name: obj.i_t1 }
142
+ - match : {test_index_2.mappings.test_type_2.i_t3.full_name: obj.i_t3 }
143
+ - length : {test_index_2.mappings.test_type_2: 2}
144
+
0 commit comments