Class Post
# ...
searchable do
text :title
text :body
text :tags
end
def self.search(params)
Post.solr_search do
...
end
end
# ...
end
Search on all text fields
# ...
Post.solr_search do
keywords params[:search]
end
# ...
Search on specific text fields with specific text params
# ...
Post.solr_search do
fulltext params[:title], fields: :title
fulltext params[:search], fields: [:body, :tags]
end
# ...