diff --git a/tests/xapian_tests/tests/xapian_query.py b/tests/xapian_tests/tests/xapian_query.py index 1c9eb51..ceff830 100644 --- a/tests/xapian_tests/tests/xapian_query.py +++ b/tests/xapian_tests/tests/xapian_query.py @@ -111,7 +111,7 @@ class XapianSearchQueryTestCase(TestCase): def test_build_query_boost(self): self.sq.add_filter(SQ(content='hello')) self.sq.add_boost('world', 5) - self.assertEqual(str(self.sq.build_query()), u'Xapian::Query(((Zhello OR hello) AND_MAYBE 5 * world))') + self.assertEqual(str(self.sq.build_query()), u'Xapian::Query(((Zhello OR hello) AND_MAYBE 5 * (Zworld OR world)))') def test_build_query_in_filter_single_words(self): self.sq.add_filter(SQ(content='why')) diff --git a/xapian_backend.py b/xapian_backend.py index 67b45ba..fbbe221 100755 --- a/xapian_backend.py +++ b/xapian_backend.py @@ -942,7 +942,7 @@ class SearchQuery(BaseSearchQuery): if self.boost: subqueries = [ xapian.Query( - xapian.Query.OP_SCALE_WEIGHT, xapian.Query(term), value + xapian.Query.OP_SCALE_WEIGHT, self._content_field(term, False), value ) for term, value in self.boost.iteritems() ] query = xapian.Query(