#NEWLINE# def scan( es_client , with_filter = None ) : #NEWLINE# #INDENT# query = { #NEWLINE# #INDENT# 'query' : { #NEWLINE# #INDENT# 'match_all' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# if ( with_filter is not None ) : #NEWLINE# #INDENT# query [ 'query' ] = { #NEWLINE# #INDENT# 'filtered' : { #NEWLINE# #INDENT# 'query' : query [ 'query' ] , #NEWLINE# 'filter' : with_filter , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# return helpers . scan ( query . conn , index = es_client . index , doc_type = es_client . t . annotation , query = query , preserve_order = True , scroll = '1h' , sort = 'updated:asc' )