post.rb ...
searchable do
text :title, :description
string :category
time :created_at
integer :post_id
end
...
post_controller.rb @search = Post.search do
fulltex
我將使用從太陽黑子索引文檔中取得的實際示例。比方說,我們有帖子與評論,然後後索引其標題和評論: class Post < ActiveRecord::Base
searchable do
text :title
text :comments do
comments.map { |comment| comment.body }
end
e
class Cat < ActiveRecord::Base
searchable do
string :color
end
end
class Dog < ActiveRecord::Base
searchable do
string :color
end
end
鑑於模型Cat和Dog以上,我該怎麼做了所有的狗+僅是棕色貓黑
我想使用太陽黑子與Rails 4,我遇到了一些問題。當我在我的Gemfile只有gem 'sunspot_rails', '2.0.0'我得到這個錯誤: Note: This task has been moved to the sunspot_solr gem. To install, start and
stop a local Solr instance, please add s