I am trying to figure out how to sort my results by the score Ferret is
returning. From the results of a search, I use the ids to then look
up their corresponding records in the database. The reason for this is
that the database records contain more information than I am storing in
the index. Any ideas? Code example below. Thanks in advance!
def index
if (params[:q])
@search_results = Array.new
index = FerretConfig::INDEX
index.search_each(params[:q]) do |doc, score|
@search_results << index[doc][:id]
end
@quotes = Quote.find(@search_results)
end
end