#NEWLINE# def es_query( self , params = None , size = None ) : #NEWLINE# #INDENT# if ( params is None ) : #NEWLINE# #INDENT# params = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# terms = [ 'search' ] #NEWLINE# q = { #NEWLINE# #INDENT# 'query' : { #NEWLINE# #INDENT# 'match_all' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# search_query = params . get ( 'search' , '' ) #NEWLINE# if search_query : #NEWLINE# #INDENT# q [ 'query' ] = { #NEWLINE# #INDENT# 'bool' : { #NEWLINE# #INDENT# 'must' : { #NEWLINE# #INDENT# 'match' : { #NEWLINE# #INDENT# '_all' : { #NEWLINE# #INDENT# 'query' : search_query , #NEWLINE# 'operator' : 'and' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# q [ 'facets' ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# q [ 'sort' ] = self . get_sorting_block ( ) #NEWLINE# start_at = self . pagination . start #NEWLINE# size = ( size if ( q is not None ) else self . pagination . count ) #NEWLINE# return es_query ( params , self . es_facet_list , terms , q , self . es_index , start_at , size , facet_size = 25 )