Skip to content

Commit

Permalink
Add default value to doc_type in index method as it is by default set…
Browse files Browse the repository at this point in the history
… to '_doc',

as while mocking with es 7.x it fails if we do not add the doc type specifically
when calling the index method with the index mock to accept doc_type by default
to _doc as with elastic search 7.x the value is set to _doc by default,
and when mocking the index method we do have to pass the doc_type as mandatory
  • Loading branch information
mohantyashish109 authored and Ashish Kumar Mohanty committed Sep 30, 2019
1 parent 987f8c0 commit f56ec6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion elasticmock/fake_elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def info(self, params=None):

@query_params('consistency', 'op_type', 'parent', 'refresh', 'replication',
'routing', 'timeout', 'timestamp', 'ttl', 'version', 'version_type')
def index(self, index, doc_type, body, id=None, params=None):
def index(self, index, body, doc_type='_doc', id=None, params=None):
if index not in self.__documents_dict:
self.__documents_dict[index] = list()

Expand Down

0 comments on commit f56ec6a

Please sign in to comment.