Skip to content

Commit

Permalink
Update es.py
Browse files Browse the repository at this point in the history
  • Loading branch information
zcqian committed Nov 8, 2021
1 parent 50e6c2f commit 2310b66
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions biothings/utils/es.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,12 @@ def get_docs(self, ids, step=None, only_source=True, **mget_args):
# chunkify
step = step or self.step
for chunk in iter_n(ids, step):
chunk_res = self._es.mget(body={"ids": chunk}, index=self._index,
doc_type=self._doc_type, **mget_args)
if self._host_major_ver > 6:
chunk_res = self._es.mget(body={"ids": chunk}, index=self._index,
**mget_args)
else:
chunk_res = self._es.mget(body={"ids": chunk}, index=self._index,
doc_type=self._doc_type, **mget_args)
for rawdoc in chunk_res['docs']:
if (('found' not in rawdoc) or (('found' in rawdoc) and not rawdoc['found'])):
continue
Expand Down

0 comments on commit 2310b66

Please sign in to comment.