SCCapstone / Social-Monomania

Webapp designed to analyze social media posts!
https://socialmonomania.herokuapp.com/
MIT License
7 stars 0 forks source link

Sort Results by Date #93

Closed Nekomian44 closed 6 years ago

Nekomian44 commented 6 years ago

For the main search results page, we should most likely sort them by date; that way, the most recent (and likely most relevant) posts will always be at the top.

Sorrento110 commented 6 years ago

RedditAPI is already trying to return them by 'new' but as you can see it's not the best date sorting. I think this is because even though the Reddit search (not the one I coded, the one Reddit did) is set to sort by new it also does some relevance sorting as well. The dates were much further out of line when I sorted by 'relevant' rather than 'new' so I know it changed something, I'm just not sure we can get it 100% without modifying the returned object.

Sorrento110 commented 6 years ago

I have confirmed it is searching by New, which does change the order compared to it's default of 'Relevant'. How I tested: Searched for 'Police' on reddit. Got results going back from 2018 in descending date. Changed the value in the redditAPI.py to say 'relevant' instead of 'new' (line 24) Searched for 'Police' again. Top result was from 2017 and the rest continue to be scrambled.

I do not think we can easily change the return if Reddit happens to give us posts out of date when we are asking them for newest posts.