stadtratmonitor/app/controllers/search_controller.rb

13 lines
473 B
Ruby
Raw Normal View History

class SearchController < ApplicationController
def index
2015-06-22 20:38:24 +02:00
@paper_type = params[:paper_type]
2015-06-22 20:43:06 +02:00
@originator = params[:originator]
options = params.slice(:paper_type, :originator)
2015-06-22 20:38:24 +02:00
@response = Paper.search(params[:q], options)
2015-06-13 21:18:55 +02:00
@papers = @response.page(params[:page]).results
2015-06-22 20:58:25 +02:00
@paper_type_facets = @response.response['aggregations']['paper_types']['buckets']
@originator_facets = @response.response['aggregations']['originators']['buckets']
end
end