Reputation: 488
I'm trying to retrieve data from Reddit using cloudsearch, I always need all posts starting a programmatically set date, let's say yesterday. I'm having trouble figuring out the syntax for MySQL equivalent WHERE timestamp > 1420070400
.
Only thing I've found out up to now is how to retrieve posts from a given range, for example timestamp:1410739200..1411171200
. I know that I can take the current date and convert it to epoch but that is prone to error because it depends on my server date which is why I want to avoid.
Any tips ?
Upvotes: 2
Views: 102
Reputation: 488
You can leave one of the sides unbounded:
timestamp:1460678641..
searches all posts starting at April 15th timestamp:..1262304000
searches all posts from before 2010The mistake I made when testing is that I didn't append syntax=cloudsearch
parameter to Reddit and while it detects automatically cloudsearch if you feed it a range, it won't if you give it just one date.
Thanks to /u/Pokechu22 on Reddit for clarifications https://www.reddit.com/r/help/comments/4g3hbn/cloudsearch_timestamp/
Upvotes: 1