def search_path_by(resource_type: nil, space_state: nil)
      new_params = {
        utf8: params[:utf8],
        filter: {
          decidim_scope_id: params.dig(:filter, :decidim_scope_id),
          term: params[:term] || params.dig(:filter, :term)
        }
      }
      new_params[:filter][:resource_type] = resource_type if resource_type.present?
      new_params[:filter][:space_state] = space_state if space_state.present?
      decidim.search_path(new_params)
    end
def search_path_by(resource_type: nil, space_state: nil)
      new_params = {
        utf8: params[:utf8],
        filter: {
          decidim_scope_id: params.dig(:filter, :decidim_scope_id),
          term: params[:term] || params.dig(:filter, :term)
        }
      }
      new_params[:filter][:resource_type] = resource_type if resource_type.present?
      new_params[:filter][:space_state] = space_state if space_state.present?
      decidim.search_path(new_params)
    end
Generates a link to filter the current search by the given type. If no
 type is given, it generates a link to the main results page.

 resource_type - An optional String with the name of the model class to filter
 space_state - An optional String with the name of the state of the space