expand post searching to include bodies (instead of titles only)

master
Aevann1 2022-06-13 19:33:20 +02:00
parent 53a8818f80
commit 74a5ea88ac
1 changed files with 3 additions and 3 deletions

View File

@ -89,7 +89,7 @@ def searchposts(v):
if 'q' in criteria:
words=criteria['q'].split()
words = criteria['q'].replace('\\', '').replace('_', '\_').replace('%', '\%').strip().split()
words=[Submission.title.ilike('%'+x+'%') for x in words]
words = [or_(Submission.title.ilike('%'+x+'%'), Submission.body.ilike('%'+x+'%')) for x in words]
posts = posts.filter(*words)
if 'over18' in criteria: posts = posts.filter(Submission.over_18==True)