#NEWLINE# def get_doc_count( es , index , refresh_first = True ) : #NEWLINE# #INDENT# if refresh_first : #NEWLINE# #INDENT# es . indices . refresh ( index ) #NEWLINE# #UNINDENT# stats = es . indices . stats ( es ) #NEWLINE# return stats [ 'indices' ] [ index ] [ 'total' ] [ 'docs' ] [ 'count' ]