#NEWLINE# @ scenario ( prepare_data , cleanup_data ) #NEWLINE# def test_simple_search_with_boolean_must( context ) : #NEWLINE# #INDENT# '\n    Search with boolean must\n    ' #NEWLINE# t = QuerySet ( 'localhost' , index = 'foo' ) #NEWLINE# add_document ( 'foo' , { #NEWLINE# #INDENT# 'bar' : 'baz' , #NEWLINE# #UNINDENT# } ) #NEWLINE# add_document ( 'foo' , { #NEWLINE# #INDENT# 'bar' : 'bazbaz' , #NEWLINE# #UNINDENT# } ) #NEWLINE# b = Bool ( ) #NEWLINE# b . must ( Term ( 'bar' , 'baz' ) ) #NEWLINE# t . filter ( b ) #NEWLINE# results = results [ 0 : 10 ] #NEWLINE# len ( results ) . should . equal ( 1 ) #NEWLINE# results [ 0 ] [ '_source' ] . should . equal ( { #NEWLINE# #INDENT# 'bar' : 'baz' , #NEWLINE# #UNINDENT# } )