I have a python script that should print all the ID's of people in my JSON files stored in elasticsearch. But I only get ten results(truncated), as I know that by default only 10 results are shown.
from elasticsearch import Elasticsearch
import sys
es = Elasticsearch()
res = es.search(index="my_docs", body={"query": {"match_all": {}}})
print("%d documents found" % res['hits']['total'])
for doc in res['hits']['hits']:
print (" Doc ID: %s" % (doc['_id']))
It says 5000 Documents found but returns 10 ID's only.
What is the way to get all documents' Doc ID's printed from my collection in Elasticsearch?