Currently I'm migrating search logic to sunspot search engine , I have a query how to implement search in the polymorphic association .
This is the model content
Class Vendor < ActiveRecord::Base has_and_belongs_to_many :specialties end
vendor table fields name,toll_free,credit
class Specialty < ActiveRecord::Base has_and_belongs_to_many :vendors end
specialty table fields name, created_at, updated_at
how to search with the specialty name and display the result where to add searchable for this association.