当我订购记录时,searchlogic 返回 nil

发布于 2024-09-08 06:11:29 字数 323 浏览 0 评论 0原文

我不明白为什么 ascend_by 对我不起作用。这是控制台读数

>>>磁带 = Tape.search(:timestamp_gte => "1278361923")
=>巴拉巴拉巴拉
>>>磁带长度
=> 1436
>>> Tapes.ascend_by_timestamp
=>零

当我使用 Descend_by 和其他列时,我会得到相同的行为。

红宝石 1.8.7
Rails 2.3.8
搜索逻辑 2.4.19

I can't figure out why ascend_by won't work for me. Here's a console readout


>> tapes = Tape.search(:timestamp_gte => "1278361923")
=> blah blah blah
>> tapes.length
=> 1436
>> tapes.ascend_by_timestamp
=> nil

I get the same behavior when I use descend_by and other columns.

ruby 1.8.7
Rails 2.3.8
searchlogic 2.4.19

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不交电费瞎发啥光 2024-09-15 06:11:29

好吧,我不知道为什么,但如果您同时添加范围,它看起来会起作用。但(奇怪的是)只有当 ascend 部分首先出现时。所以:

tapes = Tape.ascend_by_id.search(:timestamp_gte => "1278361923")

应该有效,而

tapes = Tape.search(:timestamp_gte => "1278361923").ascend_by_id

无效。

Well, I'm not sure why, but it looks like it works if you add in the scope at the same time. But (oddly) only if the ascend part comes first. So:

tapes = Tape.ascend_by_id.search(:timestamp_gte => "1278361923")

should work, while

tapes = Tape.search(:timestamp_gte => "1278361923").ascend_by_id

doesn't.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文