#NEWLINE# def get( self , request , domain ) : #NEWLINE# #INDENT# self . domain = domain #NEWLINE# self . q = self . request . GET . get ( 'q' , None ) #NEWLINE# try : #NEWLINE# #INDENT# ( count , options ) = self . get_options ( ) #NEWLINE# return self . render_json_response ( { #NEWLINE# #INDENT# 'results' : options , #NEWLINE# 'total' : count , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# except ESError as e : #NEWLINE# #INDENT# if e . q : #NEWLINE# #INDENT# logger . info ( 'ElasticSearch error caused by query "%s": %s' , self . q , e ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# notify_exception ( request , e ) #NEWLINE# #UNINDENT# #UNINDENT# return self . render_json_response ( { #NEWLINE# #INDENT# 'results' : [ ] , #NEWLINE# 'total' : 0 , #NEWLINE# #UNINDENT# } )