我不确定如何让我的产品被索引,因为我认为这就是我收到此错误的原因:
Tire::Search::SearchRequestFailed in SearchController#results
404 : {"error":"IndexMissingException[[products] missing]","status":404}
这是我的产品型号:
class Product < ActiveRecord::Base
attr_accessible :name, :description
belongs_to :user
include Tire::Model::Search
include Tire::Model::Callbacks
def self.search(params)
tire.search(load: true, page: params[:page], per_page: 10) do
query { string params[:query]} if params[:query].present?
end
end
end
如果这是问题,我如何索引我的产品?
谢谢你。