2014-11-19 17:07:05 +01:00
|
|
|
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']
|
2015-06-01 23:53:45 +02:00
|
|
|
end
|
2014-11-19 17:07:05 +01:00
|
|
|
end
|