Updated SearchQuery._content_field to properly build phrase queries, restricting them to the document field.
This commit is contained in:
parent
6a7c2ef9bf
commit
710e9b7368
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue