@@ -67,23 +67,15 @@ def query
6767 def filters
6868 f = [ ]
6969 f . push filter ( @params [ :collection ] , 'collections' ) if @params [ :collection ]
70- if @params [ :contributor ]
71- f . push filter ( @params [ :contributor ] , 'contributors' )
72- end
70+ f . push filter ( @params [ :contributor ] , 'contributors' ) if @params [ :contributor ]
7371
74- if @params [ :content_type ]
75- f . push filter_single ( @params [ :content_type ] , 'content_type' )
76- end
72+ f . push filter_single ( @params [ :content_type ] , 'content_type' ) if @params [ :content_type ]
7773
78- if @params [ :content_format ]
79- f . push filter ( @params [ :content_format ] , 'format' )
80- end
74+ f . push filter ( @params [ :content_format ] , 'format' ) if @params [ :content_format ]
8175
8276 f . push filter ( @params [ :language ] , 'languages' ) if @params [ :language ]
8377
84- if @params [ :literary_form ]
85- f . push filter_single ( @params [ :literary_form ] , 'literary_form' )
86- end
78+ f . push filter_single ( @params [ :literary_form ] , 'literary_form' ) if @params [ :literary_form ]
8779
8880 f . push filter_single ( @params [ :source ] , 'source' ) if @params [ :source ]
8981 f . push filter ( @params [ :subject ] , 'subjects' ) if @params [ :subject ]
@@ -112,7 +104,7 @@ def filter(param, field)
112104 }
113105 )
114106 else
115- terms . push ( ' term' : { "#{ field } .keyword" : t } )
107+ terms . push ( term : { "#{ field } .keyword" : t } )
116108 end
117109 end
118110
@@ -122,7 +114,7 @@ def filter(param, field)
122114 # use `filter_single` when we only accept a single value in our data model
123115 def filter_single ( param , field )
124116 {
125- ' term' : { "#{ field } .keyword" : param }
117+ term : { "#{ field } .keyword" : param }
126118 }
127119 end
128120
0 commit comments