class SearchController < ApplicationController
  def all
    response = Hdo::Search::Searcher.new(params[:query]).all
    @results = []

    if response.success?
      @results = response.results.group_by { |e| e.type }

      respond_to do |format|
        format.html
      end
    else
      flash.alert = t('app.errors.search')
    end
  end
end

class SearchController < ApplicationController
  TYPE_ORDER = %w[
    issue
    topic
    representative
    parliament_issue
    proposition
    promise
  ]

  def all
    response = Hdo::Search::Searcher.new(params[:query]).all
    @results = []

    if response.success?
      @results = response.results.
                          group_by { |e| e.type }.
                          sort_by { |t, _| TYPE_ORDER.index(t) || 10 }
    else
      flash.alert = t('app.errors.search')
    end
  end
end

Fix order of result groups.
Fix order of result groups.
