How to get all documents in Elasticsearch?

(Summer) #1

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.

(Mark Harwood) #2

There are two approaches to calling the elasticsearch API that allow access to large numbers of docs (scroll and search after).
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

(Summer) #3

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 [status:404 request:1.197s]
Traceback (most recent call last):
File "<pyshell#19>", line 1, in"my_index-2018.02.06")
File "C:\Users\summer.lively\AppData\Local\Programs\Python\Python37\lib\site-packages\elasticsearch\client\", 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\", 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\", 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\", 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')

(Eykilles) #4

Same error with me, as indicated above.

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


Thank you!

(system) #5

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