Closed libertysoft3 closed 5 years ago
It's just &sort=top
; all other parameters and sorts work fine.
And so do other subs.
Were upvote and downvote renamed in the database? That could be causing it. They're still addressed by those names in some files, like /r2/r2/lib/subreddit_search.py.
I think your issue is that 43a18709cf70a6cb45a10e9692fc05712665f2df didn't change the queries.
I was thinking of using git bisect
on the test server to find out where the problem was, but the test server doesn't appear to have working search at all… or working pages.
Thanks for your work on this. So the default sub search is for 'relevance', but on the search results page you get another sort picker with 'top'. If you choose 'top' then you get a 500 error.
Yes; as far as I can tell it's only "top" that has the issue. I'm starting to doubt the query explanation, since it looks like they're generated from SQLAlchemy and I can't find any buggy SQLAlchemy-using code.
resolved by 9ef5ff00bbfafca4cfb36125a3abf0d1f6c8e77b
@wizzwizz4 they were trying to search by field 'top' but that doesn't exist, I had to specify it should use ups and downs to determine top.
Argh! I skipped past that because I was looking for a "where" or "sort by" clause.
I'm not sure about lines 316–317; from what I can tell, "link" is the internal Reddit name for links and text posts, so you might've broken something by making it make sense.
@wizzwizz4, that link search function is for all links, so restricting it to return links only seems appropriate.
Give it a demo on site, it's way saner. Thank you for reviewing my code.
Oh, yeah; you're right. It seems to work better now.
As reported this fails: https://saidit.net/s/SaidIt/search?q=vote&sort=top&restrict_sr=on
Edit: also broken:
Works: