api icon indicating copy to clipboard operation
api copied to clipboard

Score not showing in sorted order

Open iknoorjobs opened this issue 5 years ago • 3 comments

For this endpoint, score does not show up (shows 1 only). Also results are not sorted even after passing sort parameter as score. http://api.pushshift.io/reddit/comment/search/?link_id=91ps39&size=50&sort_type=score&sort=desc

But if I explicitly mention score parameter then the results are correct. http://api.pushshift.io/reddit/comment/search/?link_id=91ps39&size=50&sort_type=score&sort=desc&score=>-100

Why this? Please check

iknoorjobs avatar Aug 27 '19 04:08 iknoorjobs

This is an artifact of using both Postgres and ES to return results based on what parameters are passed. At the time, Postgres was faster for certain queries but improvements to ES now allow for a Lucene index to be created which makes using Postgres in combination with ES less desirable.

This will get fixed in the future API release once Postgres is removed entirely from the API. In the meantime, I would suggest using the second method to get the updated score.

pushshift avatar Aug 27 '19 05:08 pushshift

Having the same issue here. Had to sort by num_comments.

Let me know if there is something I can do to help!

duarteocarmo avatar Dec 19 '19 07:12 duarteocarmo

Hopefully, this gets fixed soon as the issues still persist and only can be sorted by num_comments. Thanks.

imbarismustafa avatar Jan 03 '20 02:01 imbarismustafa