Updated SearchQuery._content_field to properly build phrase queries, restricting them to the document field.

This commit is contained in:
David Sauve 2011-06-15 15:07:22 -07:00
parent 6a7c2ef9bf
commit 710e9b7368
1 changed files with 4 additions and 2 deletions

View File

@ -1013,10 +1013,12 @@ class SearchQuery(BaseSearchQuery):
if ' ' in term:
if is_not:
return xapian.Query(
xapian.Query.OP_AND_NOT, self._all_query(), self._phrase_query(term.split())
xapian.Query.OP_AND_NOT, self._all_query(), self._phrase_query(
term.split(), self.backend.content_field_name
)
)
else:
return self._phrase_query(term.split())
return self._phrase_query(term.split(), self.backend.content_field_name)
else:
if is_not:
return xapian.Query(xapian.Query.OP_AND_NOT, self._all_query(), self._term_query(term))