Rails 4.2.8。
Solr的
太阳黑子
原始请求是
@orders = current_user
.customer
.orders
.includes(
address: { delivery_zone: :franchise },
restaurant_orders: { restaurant: :franchise },
ordered_items: :menu_item
)
.order(created_at: :desc)
Solr搜索请求
@orders = Order.search do
fulltext params[:query] if params[:query]
with :customer_id, current_user.customer.id
order_by :id, params[:sort] || :desc
paginate :page => params[:page] || 1, :per_page => 10
如何重新构建Solr搜索请求以添加
.includes(
address: { delivery_zone: :franchise },
restaurant_orders: { restaurant: :franchise },
ordered_items: :menu_item
)
提前致谢。