mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-01 04:16:24 -05:00
Fixing bug where multiple words could not be used in docs search.
This commit is contained in:
parent
1c79c1c495
commit
14cfc87bce
2 changed files with 12 additions and 1 deletions
|
|
@ -364,7 +364,7 @@ def _search_docs(search_str=None, author=None, subject=None, language=None, mime
|
|||
query = session.query(FileGroup).join(Doc, Doc.file_group_id == FileGroup.id)
|
||||
|
||||
if search_str:
|
||||
query = query.filter(FileGroup.textsearch.match(search_str))
|
||||
query = query.filter(FileGroup.textsearch.op('@@')(func.websearch_to_tsquery(search_str)))
|
||||
|
||||
if author:
|
||||
query = query.filter(FileGroup.b_text.ilike(f'%{author}%'))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue