elasticsearch - Fetch all the rows using elasticsearch_dsl -


currently using following program extract id , severity information elastic search .

from elasticsearch import elasticsearch elasticsearch_dsl import search, q  client = elasticsearch(     [         #'http://user:secret@10.x.x.11:9200/',         'http://10.x.x.11:9200/',     ],     verify_certs=true )  s = search(using=client, index="test")  response = s.execute()  hit in response:   print hit.message_id, hit.severity,  "\n\n" 

i believe default query returns 10 rows. having more 10000 rows in elastic search. need fetch information.

can 1 guide me how run same query fetch records ?

you can use scan() helper function in order retrieve docs test index:

from elasticsearch import elasticsearch, helpers  client = elasticsearch(     [         #'http://user:secret@10.x.x.11:9200/',         'http://10.x.x.11:9200/',     ],     verify_certs=true )  docs = list(helpers.scan(client, index="test", query={"query": {"match_all": {}}}))  hit in docs:   print hit.message_id, hit.severity,  "\n\n" 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -