I am using rails with solr
I want to search on user and my user table have 12 field my mode is User
name,city,state,image,comment,status,note etc ...
in my user model
searchable do
text :name, :city
end
when I do search using
@search = User.search do
fulltext params[:search]
end
@users = @search.results
This will return me all field from database but I only wont three field name,city,state how can I get only three field using solr search. how can achieve this ?
I'm not really sure why you would do that but anyway you can use
@search.hits
instead of@search.results
and load whatever you want using ids.