Help with querying all the documents within a given @timestamp field from an index

Hi , I could really use some help with querying all the documents from an index between the @timestamp value of may 21 and may 22 ,. I'm using the python client as of now but it only seems to return 10,000 of these documents , how do i get all of them and probably save them to a csv .
Some help would really be appreciated.

Welcome.

Have a look at the scroll API and this scan helper: Client helpers | Elastic Documentation

I tried using the Scan helper , but when iterating through the generator , It didn't display anything .

response = scan(client,
    query={"query": {"match": {
                "@timestamp":"2025-05-21"
            }}},
    index="orders-*",
    preserve_order=True
)

Could you share a full example of the code?

Hey , thank you so much for helping I realised I didn't actually put the right index name into the helper .
Really appreciate the help!