新手问题 sunspot + mongoid 搜不到结果

dxwts · January 04, 2014 · Last by dxwts replied at January 05, 2014 · 2147 hits

请教各位如题 gem 用 gem 'sunspot_rails' gem 'sunspot_mongoid' 按 github 上文档添加的 中途执行 rake sunspot:reindex 遇到错误 undefined method `find_in_batches' 后来根据网上的资料改成 rake sunspot:reindex[false] 可以了不过不知到是否可以这样试过之后没错,但搜不到结果,就换了个 sunspot_mongoid 现在用https://github.com/kristianmandrup/sunspot_mongoid运行没有报错可还是一直搜不到结果,大概是什么原因?

实际我搜的东西不多,开始我用 mongoid_search(https://github.com/mauriciozaffari/mongoid_searchsunspot)也搜不到结果才换的

我知道用 mongoid_search 为什么错了,是 rake mongoid_search:index 没成功,sunspot 可能也是 sunspot:reindex 没成功,但不知到怎么办,找到个方法https://groups.google.com/forum/#!topic/ruby-sunspot/uHHDK4AAwXg,还未验证

#1 楼 @dxwts 看这个代码 https://github.com/huacnlee/imax.im 里面有 sunspot 实现搜索的

#2 楼 @huacnlee 嗯,谢谢华顺

You need to Sign in before reply, if you don't have an account, please Sign up first.