Skip to content

Commit

Permalink
Remove mapping name from bulk API URL
Browse files Browse the repository at this point in the history
(cherry picked from commit e779115)
  • Loading branch information
MoteHue authored and seunghun1ee committed Jul 1, 2024
1 parent cbe6453 commit 01a0057
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cloudkitty/storage/v2/elasticsearch/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def bulk_with_instruction(self, instruction, terms):
"""Does a POST request against ES's bulk API
The POST request will be done against
`/<index_name>/<mapping_name>/_bulk`
`/<index_name>/_bulk`
The instruction will be appended before each term. For example,
bulk_with_instruction('instr', ['one', 'two']) will produce::
Expand All @@ -246,7 +246,7 @@ def bulk_with_instruction(self, instruction, terms):
*[(instruction, json.dumps(term)) for term in terms]
)) + '\n'
url = '/'.join(
(self._url, self._index_name, self._mapping_name, '_bulk'))
(self._url, self._index_name, '_bulk'))
return self._req(self._sess.post, url, data, None, deserialize=False)

def bulk_index(self, terms):
Expand Down
2 changes: 1 addition & 1 deletion cloudkitty/tests/storage/v2/elasticsearch/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def test_bulk_with_instruction(self):
self.client.bulk_with_instruction(instruction, terms)
rmock.assert_called_once_with(
self.client._sess.post,
'http://elasticsearch:9200/index_name/test_mapping/_bulk',
'http://elasticsearch:9200/index_name/_bulk',
expected_data, None, deserialize=False)

def test_bulk_index(self):
Expand Down

0 comments on commit 01a0057

Please sign in to comment.