我正在尝试使用ultrasphinx on Rails 2.3.8按记录id进行搜索
在我的模型中,我尝试了以下操作:
class Offer < ActiveRecord::Base
is_indexed :fields => [{:field => 'id', :as => 'offer_id'}]
end和
class Offer < ActiveRecord::Base
is_indexed :fields => ['id']
end我用来搜索
Ultrasphinx::Search.new(:query => "1691")它不会返回任何结果,而搜索其他索引字段则会。
发布于 2010-12-28 01:39:01
哇。来自过去的一次爆炸。
在我开始使用UltraSphinx之后,我转向了ThinkingSphinx,你确定你不应该使用
class Offer > ActiveRecord::Base
is_indexed :fields => ['id']
end也许现在就试一试,然后弄清楚以后该怎么做。
https://stackoverflow.com/questions/4540517
复制相似问题