Fixed broken __startswith (removing FLAG_PARTIAL changed how this works). This closes issue #64.
This commit is contained in:
parent
2d8ef676a0
commit
a07a980662
|
@ -414,13 +414,9 @@ class LiveXapianSearchQueryTestCase(TestCase):
|
|||
self.assertEqual(self.sq.get_spelling_suggestion(), u'indexed')
|
||||
self.assertEqual(self.sq.get_spelling_suggestion('indxd'), u'indexed')
|
||||
|
||||
def test_startswith_wildcard(self):
|
||||
self.sq.add_filter(SQ(name__startswith='da*'))
|
||||
def test_startswith(self):
|
||||
self.sq.add_filter(SQ(name__startswith='da'))
|
||||
self.assertEqual([result.pk for result in self.sq.get_results()], [1, 2, 3])
|
||||
|
||||
def test_startswith_fullword(self):
|
||||
self.sq.add_filter(SQ(name__startswith='daniel1'))
|
||||
self.assertEqual([result.pk for result in self.sq.get_results()], [1])
|
||||
|
||||
def test_build_query_gt(self):
|
||||
self.sq.add_filter(SQ(name__gt='m'))
|
||||
|
|
|
@ -1064,9 +1064,9 @@ class SearchQuery(BaseSearchQuery):
|
|||
return xapian.Query(
|
||||
xapian.Query.OP_AND_NOT,
|
||||
self._all_query(),
|
||||
self.backend.parse_query('%s:%s' % (field, term)),
|
||||
self.backend.parse_query('%s:%s*' % (field, term)),
|
||||
)
|
||||
return self.backend.parse_query('%s:%s' % (field, term))
|
||||
return self.backend.parse_query('%s:%s*' % (field, term))
|
||||
|
||||
def _filter_gt(self, term, field, is_not):
|
||||
return self._filter_lte(term, field, is_not=(is_not != True))
|
||||
|
|
Loading…
Reference in New Issue
Block a user