mirror of
https://github.com/Hopiu/xapian-haystack.git
synced 2026-03-29 04:30:31 +00:00
Updated SearchQuery._content_field to properly build phrase queries, restricting them to the document field.
This commit is contained in:
parent
6a7c2ef9bf
commit
710e9b7368
1 changed files with 4 additions and 2 deletions
|
|
@ -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 a new issue