Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ GEM
method_source (1.0.0)
mimemagic (0.3.5)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
mini_portile2 (2.5.0)
minitest (5.14.2)
mitlibraries-theme (0.4.0)
rails (~> 5)
Expand All @@ -155,8 +155,9 @@ GEM
multi_json (1.14.1)
multipart-post (2.1.1)
nio4r (2.5.4)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
nokogiri (1.11.1)
mini_portile2 (~> 2.5.0)
racc (~> 1.4)
orm_adapter (0.5.0)
parallel (1.20.1)
parser (2.7.2.0)
Expand All @@ -165,6 +166,7 @@ GEM
public_suffix (4.0.6)
puma (5.1.0)
nio4r (~> 2.0)
racc (1.5.2)
rack (2.2.3)
rack-attack (6.3.1)
rack (>= 1.0, < 3)
Expand Down
24 changes: 12 additions & 12 deletions app/views/api/v1/search/_aggregations.json.jbuilder
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
json.aggregations do
json.language @results['aggregations']['languages']['buckets'] do |x|
json.source @results['aggregations']['source']['buckets'] do |x|
json.name x['key']
json.count x['doc_count']
end

if @results['aggregations']['collections']
json.collection @results['aggregations']['collections']['buckets'] do |x|
json.name x['key']
json.count x['doc_count']
end
json.content_format @results['aggregations']['content_format']['buckets'] do |x|
json.name x['key']
json.count x['doc_count']
end

json.content_type @results['aggregations']['content_type']['buckets'] do |x|
json.name x['key']
json.count x['doc_count']
end

if @results['aggregations']['collections']
json.collection @results['aggregations']['collections']['buckets'] do |x|
json.name x['key']
json.count x['doc_count']
end
end

json.contributor @results['aggregations']['contributors']['contributor_names']['buckets'] do |x|
json.name x['key']
json.count x['doc_count']
Expand All @@ -26,7 +31,7 @@ json.aggregations do
json.count x['doc_count']
end

json.content_format @results['aggregations']['content_format']['buckets'] do |x|
json.language @results['aggregations']['languages']['buckets'] do |x|
json.name x['key']
json.count x['doc_count']
end
Expand All @@ -35,9 +40,4 @@ json.aggregations do
json.name x['key']
json.count x['doc_count']
end

json.source @results['aggregations']['source']['buckets'] do |x|
json.name x['key']
json.count x['doc_count']
end
end