mirror of
https://github.com/CodeforLeipzig/stadtratmonitor.git
synced 2025-04-20 07:11:33 +02:00
add filter by paper_type
This commit is contained in:
parent
7a7083c2ad
commit
41ed4a9674
2 changed files with 27 additions and 9 deletions
|
@ -1,6 +1,9 @@
|
|||
class SearchController < ApplicationController
|
||||
def index
|
||||
@response = Paper.search(params[:q])
|
||||
@paper_type = params[:paper_type]
|
||||
options = params.slice(:paper_type)
|
||||
|
||||
@response = Paper.search(params[:q], options)
|
||||
@papers = @response.page(params[:page]).results
|
||||
@paper_type_facets = @response.response['aggregations']['paper_types']['buckets'].map {|h| [ h['key'], h['doc_count']] }
|
||||
@originator_facets = @response.response['aggregations']['originators']['buckets'].map {|h| [ h['key'], h['doc_count']] }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue