#NEWLINE# def _is_valid_ElasticSearch_query( self , x , bug ) : #NEWLINE# #INDENT# query = qb . generic ( x [ 'query' ] ) #NEWLINE# try : #NEWLINE# #INDENT# results = self . classifier . es . search ( query , size = '10' ) #NEWLINE# #UNINDENT# except pyelasticsearch . ElasticHttpError : #NEWLINE# #INDENT# self . fail ( ( 'Failure to process query for bug %s' % bug ) ) #NEWLINE# #UNINDENT# valid_query = ( len ( results ) > 0 ) #NEWLINE# if ( not valid_query ) : #NEWLINE# #INDENT# print ( ( "Didn't find any hits for bug %s" % x [ 'bug' ] ) ) #NEWLINE# #UNINDENT# return True