from django.conf import settings
from elasticsearch import Elasticsearch, helpers
es = Elasticsearch(settings.ELASTICSEARCH_URL)
query = {"filter": {"wildcard": {"text": "*"}}, "fields": []}
with open('../rel1.txt', 'w', encoding='utf-8') as f:
    for doc in helpers.scan(es, index='hoover-6', query=query):
        print(doc['_id'], file=f)

@@ -175,19 +175,23 @@
 %7D, %22
-fields%22: %5B%5D
+_source%22: false
 %7D%0Awi
@@ -303,16 +303,28 @@
 ry=query
+, size=10000
 ):%0A     
@@ -352,8 +352,43 @@
 file=f)%0A
+%0A# should return 1231116 documents%0A

optimize the retrieval