mirror of
https://github.com/Hopiu/xapian-haystack.git
synced 2026-04-24 08:34:52 +00:00
Six passing tests. Combining AND, OR, NOT works.
This commit is contained in:
parent
d7e606f0d5
commit
d6a24ef33c
1 changed files with 5 additions and 6 deletions
|
|
@ -70,12 +70,11 @@ class XapianSearchQueryTestCase(TestCase):
|
|||
self.sq.add_filter(SQ(content='hello') | SQ(content='world'))
|
||||
self.assertEqual(self.sq.build_query().get_description(), 'Xapian::Query((hello OR world))')
|
||||
|
||||
# def test_build_query_multiple_words_mixed(self):
|
||||
# self.sq.add_filter('content', 'why')
|
||||
# self.sq.add_filter('content', 'hello', use_or=True)
|
||||
# self.sq.add_filter('content', 'world', use_not=True)
|
||||
# self.assertEqual(self.sq.build_query(), 'why OR hello NOT world')
|
||||
#
|
||||
def test_build_query_multiple_words_mixed(self):
|
||||
self.sq.add_filter(SQ(content='why') | SQ(content='hello'))
|
||||
self.sq.add_filter(~SQ(content='world'))
|
||||
self.assertEqual(self.sq.build_query().get_description(), 'Xapian::Query(((why OR hello) AND (<alldocuments> AND_NOT world)))')
|
||||
|
||||
# def test_build_query_phrase(self):
|
||||
# self.sq.add_filter('content', 'hello world')
|
||||
# self.assertEqual(self.sq.build_query(), '"hello world"')
|
||||
|
|
|
|||
Loading…
Reference in a new issue