I am trying to prioritize "sort by" in a multi-value field using solr - any idea how can I follow below?
searchable do
integer: skill_ids,: multiple => true
end
def self.filter_using_solr (opts = {})
Sunspot.search (JobApplication) do | s |
opts [: order_skill_ids] .each do | skill_id |
s.order_by (: skill_ids, skill_id)
end
end
end
end
I get the following exception: "skill_ids cannot be used for ordering because it is a field with multiple values," but not sure about the alternative path.
source share