简体   繁体   English

Cloudsearch 开始日期和现在

[英]Cloudsearch starting date and now

I'm trying to retrieve data from Reddit using cloudsearch, I always need all posts starting a programmatically set date, let's say yesterday.我正在尝试使用 cloudsearch 从 Reddit 检索数据,我总是需要所有帖子以编程方式设置的日期开始,比如说昨天。 I'm having trouble figuring out the syntax for MySQL equivalent WHERE timestamp > 1420070400 .我无法弄清楚 MySQL 等效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 .到目前为止,我唯一发现的是如何从给定范围内检索帖子,例如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 ?有小费吗 ?

You can leave one of the sides unbounded:您可以让其中一侧不受限制:

  • timestamp:1460678641.. searches all posts starting at April 15th timestamp:1460678641..搜索从 4 月 15 日开始的所有帖子
  • timestamp:..1262304000 searches all posts from before 2010 timestamp:..1262304000搜索 2010 年之前的所有帖子

The 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.我在测试时犯的错误是我没有将syntax=cloudsearch参数附加到 Reddit,虽然它会自动检测 cloudsearch 如果你提供一个范围,如果你只给它一个日期就不会。

Thanks to /u/Pokechu22 on Reddit for clarifications https://www.reddit.com/r/help/comments/4g3hbn/cloudsearch_timestamp/感谢 Reddit 上的 /u/Pokechu22 澄清https://www.reddit.com/r/help/comments/4g3hbn/cloudsearch_timestamp/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM