#NEWLINE# def test_q( self ) : #NEWLINE# #INDENT# qs = self . _filter ( data = { #NEWLINE# #INDENT# 'q' : 'tea pot' , #NEWLINE# #UNINDENT# } ) #NEWLINE# should = qs [ 'query' ] [ 'function_score' ] [ 'query' ] [ 'bool' ] [ 'should' ] #NEWLINE# expected = { #NEWLINE# #INDENT# 'match' : { #NEWLINE# #INDENT# 'name' : { #NEWLINE# #INDENT# 'query' : 'tea pot' , #NEWLINE# 'boost' : 4 , #NEWLINE# 'slop' : 1 , #NEWLINE# 'type' : 'phrase' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# assert ( expected in self ) #NEWLINE# expected = { #NEWLINE# #INDENT# 'prefix' : { #NEWLINE# #INDENT# 'name' : { #NEWLINE# #INDENT# 'boost' : 1.5 , #NEWLINE# 'value' : 'tea pot' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# assert ( expected in should ) #NEWLINE# expected = { #NEWLINE# #INDENT# 'match' : { #NEWLINE# #INDENT# 'name_english' : { #NEWLINE# #INDENT# 'query' : 'tea pot' , #NEWLINE# 'boost' : 2.5 , #NEWLINE# 'analyzer' : 'english' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# assert ( expected in should ) #NEWLINE# expected = { #NEWLINE# #INDENT# 'match' : { #NEWLINE# #INDENT# 'description_english' : { #NEWLINE# #INDENT# 'query' : 'tea pot' , #NEWLINE# 'boost' : 0.6 , #NEWLINE# 'analyzer' : 'english' , #NEWLINE# 'type' : 'phrase' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# assert ( expected in should )