mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-20 23:16:17 -05:00
Not searching URL to speed up search query.
This commit is contained in:
parent
bd431165e5
commit
1fbfb990f1
2 changed files with 3 additions and 2 deletions
|
|
@ -731,8 +731,8 @@ def search_files(search_str: str, limit: int, offset: int, mimetypes: List[str]
|
|||
joins = []
|
||||
|
||||
if search_str:
|
||||
# Search by textsearch, and by matching url.
|
||||
wheres.append("(textsearch @@ websearch_to_tsquery(%(search_str)s) OR fg.url ILIKE %(url_search_str)s)")
|
||||
# Search by textsearch column.
|
||||
wheres.append('textsearch @@ websearch_to_tsquery(%(search_str)s)')
|
||||
selects.append('ts_rank(textsearch, websearch_to_tsquery(%(search_str)s))')
|
||||
order_by = '2 DESC'
|
||||
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ class FileGroup(ModelHelper, Base):
|
|||
id: int = Column(BigInteger, primary_key=True)
|
||||
|
||||
author = Column(String) # name of the author, maybe even a URL
|
||||
censored = Column(Boolean) # the file is no longer available for download
|
||||
data = Column(FancyJSON) # populated by the modeler
|
||||
download_datetime = Column(TZDateTime) # the date WROLPi downloaded this file.
|
||||
files = Column(FancyJSON, nullable=False) # populated during discovery
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue