Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove limitation for elasticsearch library #16553

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions setup.py
Expand Up @@ -275,8 +275,8 @@ def get_sphinx_theme_version() -> str:
'pydruid>=0.4.1',
]
elasticsearch = [
'elasticsearch>7, <7.6.0',
'elasticsearch-dbapi==0.1.0',
'elasticsearch>7',
'elasticsearch-dbapi',
'elasticsearch-dsl>=5.0.0',
]
exasol = [
Expand Down
Expand Up @@ -88,7 +88,7 @@ def info(self, params=None):
'version',
'version_type',
)
def index(self, index, doc_type, body, id=None, params=None):
def index(self, index, doc_type, body, id=None, params=None, headers=None):
if index not in self.__documents_dict:
self.__documents_dict[index] = []

Expand All @@ -98,10 +98,24 @@ def index(self, index, doc_type, body, id=None, params=None):
version = 1

self.__documents_dict[index].append(
{'_type': doc_type, '_id': id, '_source': body, '_index': index, '_version': version}
{
'_type': doc_type,
'_id': id,
'_source': body,
'_index': index,
'_version': version,
'_headers': headers,
}
)

return {'_type': doc_type, '_id': id, 'created': True, '_version': version, '_index': index}
return {
'_type': doc_type,
'_id': id,
'created': True,
'_version': version,
'_index': index,
'_headers': headers,
}

@query_params('parent', 'preference', 'realtime', 'refresh', 'routing')
def exists(self, index, doc_type, id, params=None):
Expand Down Expand Up @@ -198,7 +212,7 @@ def get_source(self, index, doc_type, id, params=None):
'track_scores',
'version',
)
def count(self, index=None, doc_type=None, body=None, params=None):
def count(self, index=None, doc_type=None, body=None, params=None, headers=None):
searchable_indexes = self._normalize_index_to_list(index)
searchable_doc_types = self._normalize_doc_type_to_list(doc_type)

Expand Down Expand Up @@ -247,7 +261,7 @@ def count(self, index=None, doc_type=None, body=None, params=None):
'track_scores',
'version',
)
def search(self, index=None, doc_type=None, body=None, params=None):
def search(self, index=None, doc_type=None, body=None, params=None, headers=None):
searchable_indexes = self._normalize_index_to_list(index)

matches = self._find_match(index, doc_type, body)
Expand Down Expand Up @@ -275,7 +289,7 @@ def search(self, index=None, doc_type=None, body=None, params=None):
@query_params(
'consistency', 'parent', 'refresh', 'replication', 'routing', 'timeout', 'version', 'version_type'
)
def delete(self, index, doc_type, id, params=None):
def delete(self, index, doc_type, id, params=None, headers=None):

found = False

Expand Down