Skip to content

Instantly share code, notes, and snippets.

@drorata
Created August 4, 2014 07:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drorata/ef9c0d2012bfc630b565 to your computer and use it in GitHub Desktop.
Save drorata/ef9c0d2012bfc630b565 to your computer and use it in GitHub Desktop.
sid=res['_scroll_id']
IDs=[]
scroll_size=res['hits']['total']
while (scroll_size > 0):
sys.stdout.write('.')
sys.stdout.flush()
try:
res=es.scroll(scroll_id=sid,scroll='1m')
IDs += res['hits']['hits']
sid=res['_scroll_id']
scroll_size=len(res['hits']['hits'])
except:
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment