Sorting 可搜索的Solr太阳黑子干涸模型
我想干掉我的模特;但太阳黑子在一个模型中只允许一(1)“可搜索”块。做2只会忽略第二个。下面的失败示例: digital.rbSorting 可搜索的Solr太阳黑子干涸模型,sorting,ruby-on-rails-4,search,model,sunspot-solr,Sorting,Ruby On Rails 4,Search,Model,Sunspot Solr,我想干掉我的模特;但太阳黑子在一个模型中只允许一(1)“可搜索”块。做2只会忽略第二个。下面的失败示例: digital.rb class Digital < ActiveRecord::Base include BaseConcerns belongs_to :digitable, polymorphic: true # IGNORES THIS searchable do string :url text :url string :re
class Digital < ActiveRecord::Base
include BaseConcerns
belongs_to :digitable, polymorphic: true
# IGNORES THIS
searchable do
string :url
text :url
string :remark
text :remark
end
end
module BaseConcerns extend ActiveSupport::Concern
included do
before_create{
self.id = UUIDTools::UUID.timestamp_create().to_s.downcase if id.blank?
}
self.primary_key = 'id'
# DOES THIS
searchable do
text :id
time :created_at
time :updated_at
end
end
end
我想干涸我的模型使用一些关注点,并希望一些类似命名的列是可搜索的;而其他人我只能具体说明;我该怎么做