@@ -158,12 +158,9 @@ def put_mapping(self, mapping):
158158 :rtype: requests.models.Response
159159 """
160160 url = '/' .join (
161- (self ._url , self ._index_name , '_mapping' , self ._mapping_name ))
162- # NOTE(peschk_l): This is done for compatibility with
163- # Elasticsearch 6 and 7.
164- param = {"include_type_name" : "true" }
161+ (self ._url , self ._index_name , self ._mapping_name ))
165162 return self ._req (
166- self ._sess .put , url , json .dumps (mapping ), param , deserialize = False )
163+ self ._sess .post , url , json .dumps (mapping ), {} , deserialize = False )
167164
168165 def get_index (self ):
169166 """Does a GET request against ES's index API.
@@ -228,7 +225,7 @@ def bulk_with_instruction(self, instruction, terms):
228225 """Does a POST request against ES's bulk API
229226
230227 The POST request will be done against
231- `/<index_name>/<mapping_name>/ _bulk`
228+ `/<index_name>/_bulk`
232229
233230 The instruction will be appended before each term. For example,
234231 bulk_with_instruction('instr', ['one', 'two']) will produce::
@@ -249,7 +246,7 @@ def bulk_with_instruction(self, instruction, terms):
249246 * [(instruction , json .dumps (term )) for term in terms ]
250247 )) + '\n '
251248 url = '/' .join (
252- (self ._url , self ._index_name , self . _mapping_name , '_bulk' ))
249+ (self ._url , self ._index_name , '_bulk' ))
253250 return self ._req (self ._sess .post , url , data , None , deserialize = False )
254251
255252 def bulk_index (self , terms ):
0 commit comments