Asset model:
searchable do
text :title
text :description
time :created_at
integer :category_ids, :multiple => true, :references => Category
end
Controller:
search = Asset.search() do
keywords(h(params[:query]), :fields => [:title, :description])
facet(:category_ids)
order_by :created_at
end
I would not like to sort my facet :Category_ides via :count (number of hits). The categories should be ordered by created_at. Looking at the documentation facet(:category_ids, :sort => :count || :index), both options won’t work for me.
How can I solve this order problem for facets?
You can just load the facets and then sort them yourself: