Я использую solr для поиска.Solr return type of object
В моей модели Клиент:
searchable do text :name end
И контроллер клиента:
def index
@search = Client.search do
fulltext params[:search]
end
@clients = @search.results
end
в консоли:
cli = Client.search
=> <Sunspot::Search:{:fq=>["type:Client"], :start=>0, :rows=>30, :q=>"*:*"}>
Как получить тип объекта (клиента) ?
cli = cli.fq (undefined method `fq' for #<Sunspot::Search::StandardSearch:0xd22ab0c>)
cli = cli.type (undefined method `type' for #<Sunspot::Search::StandardSearch:0xd22ab0c>)