Skip to content

Commit fc68f5b

Browse files
authored
Merge pull request #411 from MITLibraries/DISCO-221_facet_display_order
Updates returned order of aggregations
2 parents b4d9650 + a70c5dd commit fc68f5b

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

Gemfile.lock

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ GEM
145145
method_source (1.0.0)
146146
mimemagic (0.3.5)
147147
mini_mime (1.0.2)
148-
mini_portile2 (2.4.0)
148+
mini_portile2 (2.5.0)
149149
minitest (5.14.2)
150150
mitlibraries-theme (0.4.0)
151151
rails (~> 5)
@@ -155,8 +155,9 @@ GEM
155155
multi_json (1.14.1)
156156
multipart-post (2.1.1)
157157
nio4r (2.5.4)
158-
nokogiri (1.10.10)
159-
mini_portile2 (~> 2.4.0)
158+
nokogiri (1.11.1)
159+
mini_portile2 (~> 2.5.0)
160+
racc (~> 1.4)
160161
orm_adapter (0.5.0)
161162
parallel (1.20.1)
162163
parser (2.7.2.0)
@@ -165,6 +166,7 @@ GEM
165166
public_suffix (4.0.6)
166167
puma (5.1.0)
167168
nio4r (~> 2.0)
169+
racc (1.5.2)
168170
rack (2.2.3)
169171
rack-attack (6.3.1)
170172
rack (>= 1.0, < 3)
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
json.aggregations do
2-
json.language @results['aggregations']['languages']['buckets'] do |x|
2+
json.source @results['aggregations']['source']['buckets'] do |x|
33
json.name x['key']
44
json.count x['doc_count']
55
end
66

7-
if @results['aggregations']['collections']
8-
json.collection @results['aggregations']['collections']['buckets'] do |x|
9-
json.name x['key']
10-
json.count x['doc_count']
11-
end
7+
json.content_format @results['aggregations']['content_format']['buckets'] do |x|
8+
json.name x['key']
9+
json.count x['doc_count']
1210
end
1311

1412
json.content_type @results['aggregations']['content_type']['buckets'] do |x|
1513
json.name x['key']
1614
json.count x['doc_count']
1715
end
1816

17+
if @results['aggregations']['collections']
18+
json.collection @results['aggregations']['collections']['buckets'] do |x|
19+
json.name x['key']
20+
json.count x['doc_count']
21+
end
22+
end
23+
1924
json.contributor @results['aggregations']['contributors']['contributor_names']['buckets'] do |x|
2025
json.name x['key']
2126
json.count x['doc_count']
@@ -26,7 +31,7 @@ json.aggregations do
2631
json.count x['doc_count']
2732
end
2833

29-
json.content_format @results['aggregations']['content_format']['buckets'] do |x|
34+
json.language @results['aggregations']['languages']['buckets'] do |x|
3035
json.name x['key']
3136
json.count x['doc_count']
3237
end
@@ -35,9 +40,4 @@ json.aggregations do
3540
json.name x['key']
3641
json.count x['doc_count']
3742
end
38-
39-
json.source @results['aggregations']['source']['buckets'] do |x|
40-
json.name x['key']
41-
json.count x['doc_count']
42-
end
4343
end

0 commit comments

Comments
 (0)