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

**URL:** <https://discuss.elastic.co/t/help-with-querying-all-the-documents-within-a-given-timestamp-field-from-an-index/378562>\
**Category:** Elasticsearch\
**Created:** [May 27, 2025, 6:03am UTC](https://discuss.elastic.co/t/help-with-querying-all-the-documents-within-a-given-timestamp-field-from-an-index/378562 "2025-05-27T06:03:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikhil\_Shivanath](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nikhil_shivanath/32/143354_2.png) [@Nikhil\_Shivanath](https://discuss.elastic.co/u/Nikhil_Shivanath)\
**Post date:** [May 27, 2025, 6:03am UTC](https://discuss.elastic.co/t/help-with-querying-all-the-documents-within-a-given-timestamp-field-from-an-index/378562/1 "2025-05-27T06:03:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 27, 2025, 6:29am UTC](https://discuss.elastic.co/t/help-with-querying-all-the-documents-within-a-given-timestamp-field-from-an-index/378562/2 "2025-05-27T06:29:27Z")

</div>

Welcome.

Have a look at the scroll API and this scan helper: [Client helpers | Elastic Documentation](https://www.elastic.co/docs/reference/elasticsearch/clients/python/client-helpers)

---

<div class="post-metadata">

**Author:** ![Nikhil\_Shivanath](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nikhil_shivanath/32/143354_2.png) [@Nikhil\_Shivanath](https://discuss.elastic.co/u/Nikhil_Shivanath)\
**Post date:** [May 27, 2025, 6:56am UTC](https://discuss.elastic.co/t/help-with-querying-all-the-documents-within-a-given-timestamp-field-from-an-index/378562/3 "2025-05-27T06:56:16Z")

</div>

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

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

```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 27, 2025, 7:51am UTC](https://discuss.elastic.co/t/help-with-querying-all-the-documents-within-a-given-timestamp-field-from-an-index/378562/4 "2025-05-27T07:51:29Z")

</div>

Could you share a full example of the code?

---

<div class="post-metadata">

**Author:** ![Nikhil\_Shivanath](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nikhil_shivanath/32/143354_2.png) [@Nikhil\_Shivanath](https://discuss.elastic.co/u/Nikhil_Shivanath)\
**Post date:** [May 27, 2025, 8:10am UTC](https://discuss.elastic.co/t/help-with-querying-all-the-documents-within-a-given-timestamp-field-from-an-index/378562/5 "2025-05-27T08:10:01Z")

</div>

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!
