I am using this code below and it gives me the following error.
from elasticsearch import Elasticsearch, helpers
from elasticsearch_dsl import Search
es = Elasticsearch('elasticsearch', port=9200)
s = Search(using=es, index="metricinfo*").query("match", **{"mid.keyword": self.mid}).filter('range', **{"@timestamp":{'gte': 'now-7d' , 'lt': 'now'}})
s=s.extra(_source={"includes":['@timestamp','value','mid']})
s.execute()
for hit in s.scan():
print(hit['value'])
Scroll request has only succeeded on 121 shards out of 130.
Traceback (most recent call last):
File "", line 1, in
File "/opt/conda/lib/python3.6/site-packages/elasticsearch_dsl/search.py", line 726, in scan
**self._params
File "/opt/conda/lib/python3.6/site-packages/elasticsearch/helpers/init.py", line 394, in scan
(resp['_shards']['successful'], resp['_shards']['total'])
elasticsearch.helpers.ScanError: Scroll request has only succeeded on 121 shards out of 130.