@@ -182,7 +182,7 @@ def test_index_to_dict(self):
182
182
text_type = 'string' if ES_MAJOR_VERSION == 2 else 'text'
183
183
184
184
test_index = DSLIndex ('test_index' ).settings (** index_settings )
185
- test_index .doc_type (CarDocument )
185
+ test_index .document (CarDocument )
186
186
187
187
index_dict = test_index .to_dict ()
188
188
@@ -193,7 +193,7 @@ def test_index_to_dict(self):
193
193
'analyzer' : {
194
194
'html_strip' : {
195
195
'tokenizer' : 'standard' ,
196
- 'filter' : ['standard' , ' lowercase' ,
196
+ 'filter' : ['lowercase' ,
197
197
'stop' , 'snowball' ],
198
198
'type' : 'custom' ,
199
199
'char_filter' : ['html_strip' ]
@@ -202,38 +202,36 @@ def test_index_to_dict(self):
202
202
}
203
203
})
204
204
self .assertEqual (index_dict ['mappings' ], {
205
- 'doc' : {
206
- 'properties' : {
207
- 'ads' : {
208
- 'type' : 'nested' ,
209
- 'properties' : {
210
- 'description' : {
211
- 'type' : text_type , 'analyzer' :
212
- 'html_strip'
213
- },
214
- 'pk' : {'type' : 'integer' },
215
- 'title' : {'type' : text_type }
205
+ 'properties' : {
206
+ 'ads' : {
207
+ 'type' : 'nested' ,
208
+ 'properties' : {
209
+ 'description' : {
210
+ 'type' : text_type , 'analyzer' :
211
+ 'html_strip'
216
212
},
213
+ 'pk' : {'type' : 'integer' },
214
+ 'title' : {'type' : text_type }
217
215
},
218
- 'categories' : {
219
- 'type ' : 'nested' ,
220
- 'properties ' : {
221
- 'title ' : {'type' : text_type },
222
- 'slug ' : {'type' : text_type },
223
- 'icon ' : {'type' : text_type }
224
- },
216
+ },
217
+ 'categories ' : {
218
+ 'type ' : 'nested' ,
219
+ 'properties ' : {
220
+ 'title ' : {'type' : text_type },
221
+ 'slug ' : {'type' : text_type },
222
+ 'icon' : { 'type' : text_type }
225
223
},
226
- 'manufacturer' : {
227
- 'type ' : 'object' ,
228
- 'properties ' : {
229
- 'country ' : {'type' : text_type },
230
- 'name ' : {'type' : text_type }
231
- },
224
+ },
225
+ 'manufacturer ' : {
226
+ 'type ' : 'object' ,
227
+ 'properties ' : {
228
+ 'country ' : {'type' : text_type },
229
+ 'name' : { 'type' : text_type }
232
230
},
233
- 'name' : { 'type' : text_type },
234
- 'launched ' : {'type' : 'date' },
235
- 'type ' : {'type' : text_type }
236
- }
231
+ },
232
+ 'name ' : {'type' : text_type },
233
+ 'launched ' : {'type' : 'date' },
234
+ 'type' : { 'type' : text_type }
237
235
}
238
236
})
239
237
0 commit comments