Data lose while using scroll

Hi I see some data lose while using scroll. I am using the following inside python script.
Without using scroll it showing the correct number of documents but with scroll I am getting less number of documents.

Any idea about this ?

res =,scroll='1m',body=jobqry,timeout='1200s')
sid = res['_scroll_id']
scroll_size = res['hits']['total']
file_name = new_dir+"/"+clsname+".txt"
cmd_file = "touch %s" %(file_name)
while (scroll_size > 0):
res=es.scroll(scroll_id = sid, scroll ='1m')
sid = res['_scroll_id']
scroll_size = len(res['hits']['hits'])
for i in range(0,scroll_size-1):

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