# How to get all documents in Elasticsearch?

**URL:** <https://discuss.elastic.co/t/how-to-get-all-documents-in-elasticsearch/118809>\
**Category:** Elasticsearch\
**Created:** [February 7, 2018, 10:35am UTC](https://discuss.elastic.co/t/how-to-get-all-documents-in-elasticsearch/118809 "2018-02-07T10:35:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cheleyace](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cheleyace/32/27504_2.png) [@cheleyace](https://discuss.elastic.co/u/cheleyace)\
**Post date:** [February 7, 2018, 10:35am UTC](https://discuss.elastic.co/t/how-to-get-all-documents-in-elasticsearch/118809/1 "2018-02-07T10:35:56Z")

</div>

Dear all,

I would like to know how to get all the documents in Elasticsearch? I know that the default value of getting the elasticsearch was 10 and can still get up to 10,000. It seems that Kibana cannot handle the large number of data whenever I'm querying to get data. Is there any way how to get all the documents without affecting the Kibana or gettin' errors? Thank you so much.

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [February 7, 2018, 11:24am UTC](https://discuss.elastic.co/t/how-to-get-all-documents-in-elasticsearch/118809/2 "2018-02-07T11:24:31Z")

</div>

There are two approaches to calling the elasticsearch API that allow access to large numbers of docs ([scroll](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html) and [search after](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-search-after.html)).  
However, I suspect you are also talking about things at the Kibana level where it may have its own technical limits about how results are cached for presentation in the browser. If you're not using the raw elasticsearch API and asking about Kibana specifically I suggest asking this question in the Kibana forum

---

<div class="post-metadata">

**Author:** ![cheleyace](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cheleyace/32/27504_2.png) [@cheleyace](https://discuss.elastic.co/u/cheleyace)\
**Post date:** [February 8, 2018, 2:10am UTC](https://discuss.elastic.co/t/how-to-get-all-documents-in-elasticsearch/118809/3 "2018-02-08T02:10:46Z")

</div>

I found another approach to get all the data from elasticsearch using Python. Now my problem is how would I connect it to Elasticsearch? I tried using Python method and i got these errors. Can anyone help me on this?

GET [YOURHOST.us-east-1.es.amazonaws.com](http://YOURHOST.us-east-1.es.amazonaws.com) [status:404 request:1.197s]  
Traceback (most recent call last):  
File "\<pyshell#19\>", line 1, in   
es.search(index="my\_index-2018.02.06")  
File "C:\Users\summer.lively\AppData\Local\Programs\Python\Python37\lib\site-packages\elasticsearch\client\utils.py", line 73, in _wrapped  
return func(\*args, params=params, \*\*kwargs)  
File "C:\Users\summer.lively\AppData\Local\Programs\Python\Python37\lib\site-packages\elasticsearch\client\_init_.py", line 632, in search  
doc\_type, '\_search'), params=params, body=body)  
File "C:\Users\summer.lively\AppData\Local\Programs\Python\Python37\lib\site-packages\elasticsearch\transport.py", line 312, in perform\_request  
status, headers, data = connection.perform\_request(method, url, params, body, ignore=ignore, timeout=timeout)  
File "C:\Users\summer.lively\AppData\Local\Programs\Python\Python37\lib\site-packages\elasticsearch\connection\http\_requests.py", line 90, in perform\_request  
self.\_raise\_error(response.status\_code, raw\_data)  
File "C:\Users\summer.lively\AppData\Local\Programs\Python\Python37\lib\site-packages\elasticsearch\connection\base.py", line 125, in \_raise\_error  
raise HTTP\_EXCEPTIONS.get(status\_code, TransportError)(status\_code, error\_message, additional\_info)  
elasticsearch.exceptions.NotFoundError: TransportError(404, 'index\_not\_found\_exception', 'no such index')

---

<div class="post-metadata">

**Author:** ![\_kyllr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/_kyllr/32/27610_2.png) [@\_kyllr](https://discuss.elastic.co/u/_kyllr)\
**Post date:** [February 8, 2018, 2:38am UTC](https://discuss.elastic.co/t/how-to-get-all-documents-in-elasticsearch/118809/4 "2018-02-08T02:38:33Z")

</div>

Same error with me, as indicated above.

Please see screenshots below, here's what I used in this case.

![pip%20list](https://us1.discourse-cdn.com/elastic/original/3X/1/2/127cd00aeee189be9e12042951552b4140c3cdd1.PNG)

 ![script%20and%20error](https://us1.discourse-cdn.com/elastic/original/3X/7/c/7cbb3f34157a9feda3dcee5ea026a872c59b526e.PNG)

Thank you!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 8, 2018, 2:38am UTC](https://discuss.elastic.co/t/how-to-get-all-documents-in-elasticsearch/118809/5 "2018-03-08T02:38:47Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
