sunspot solr как правильно искать несколько моделей? Все примеры онлайн провалились
Как правильно искать несколько моделей в SunSpot Solr?
Модель профиля
has_one :match
searchable do
string :country
string :state
string :city
end
Модель спички
belongs_to :profile
searchable do
string :looking_for_education
integer :age_from
integer :age_to
end
ProfilesController # Index
def index
@search = Sunspot.search Profile, Match do
with(:country, params[:country])
with(:state, params[:state])
with(:looking_for_education, params[:looking_for_education])