#NEWLINE# def test_build_search_params_with_body( self ) : #NEWLINE# #INDENT# obj = es . ES ( 'Foo' , 'foondex' ) #NEWLINE# params = obj . build_search_params ( { #NEWLINE# #INDENT# 'body' : { #NEWLINE# #INDENT# 'query' : { #NEWLINE# #INDENT# 'query_string' : 'foo' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# '_raw_terms' : ' AND q:5' , #NEWLINE# '_limit' : 10 , #NEWLINE# '_search_fields' : 'a,b' , #NEWLINE# '_fields' : [ 'a' ] , #NEWLINE# '_sort' : '+a,-b,c' , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( sorted ( params . keys ( ) ) == sorted ( [ 'body' , 'doc_type' , 'fields' , 'from_' , 'index' , 'size' , 'sort' ] ) ) #NEWLINE# assert ( obj [ 'body' ] == { #NEWLINE# #INDENT# 'query' : { #NEWLINE# #INDENT# 'query_string' : { #NEWLINE# #INDENT# 'fields' : [ 'b^1' , 'a^2' ] , #NEWLINE# 'query' : 'foo' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( params [ 'index' ] == 'foondex' ) #NEWLINE# assert ( params [ 'doc_type' ] == 'Foo' ) #NEWLINE# assert ( params [ 'fields' ] == [ 'a' ] ) #NEWLINE# assert ( params [ 'sort' ] == 'a:asc,b:desc,c:asc' )