他の複数のテーブルに属する生地モデルがあります。
class Fabric < ActiveRecord::Base
validates :name, presence: true
belongs_to :design
belongs_to :composition
belongs_to :collection
belongs_to :style
belongs_to :origin
belongs_to :texture
belongs_to :supplier
has_and_belongs_to_many :colours
searchable do
text :name, :boost => 5
text :description
text :composition do
composition.name
end
text :collection do
collection.name
end
text :style do
style.name
end
text :origin do
origin.name
end
text :texture do
texture.name
end
text :supplier do
supplier.name
end
end
end
すべての逆関連付け (Has_many) などをセットアップしましたが、これらの関連付けられたすべてのテーブルの名前フィールドをクエリする全文検索を取得できないようです。
どんな助けでも大歓迎です。
@search = Fabric.search do
fulltext params[:search]
end
@fabrics = @search.results
ロス