Skip to content

Commit e7b8cdf

Browse files
Add all currently-available aggregations
** Why are these changes being introduced: This app implements only two filter / aggregation categories: content type and source. However, others are now supported by the API: Contributors, format, languages, literary form, and subjects. Others are coming soon, but for now these are what is available. ** Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/gdt-128 ** How does this address that need: This updates our search model, and filter helper, to add support for the new categories. ** Document any side effects to this change: Because all queries now include this request for more aggregations, we need to regenerate a number of the test cassettes.
1 parent 0cc75ed commit e7b8cdf

22 files changed

+283
-218
lines changed

app/helpers/filter_helper.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ def add_filter(query, filter, term)
2222
def nice_labels
2323
{
2424
contentTypeFilter: 'Content type',
25-
sourceFilter: 'Source'
25+
contributorsFilter: 'Contributor',
26+
formatFilter: 'Format',
27+
languagesFilter: 'Language',
28+
literaryFormFilter: 'Literary form',
29+
sourceFilter: 'Source',
30+
subjectsFilter: 'Subject'
2631
}
2732
end
2833

app/models/timdex_search.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,30 @@ class TimdexSearch < TimdexBase
6060
key
6161
docCount
6262
}
63+
contributors {
64+
key
65+
docCount
66+
}
67+
format {
68+
key
69+
docCount
70+
}
71+
languages {
72+
key
73+
docCount
74+
}
75+
literaryForm {
76+
key
77+
docCount
78+
}
6379
source {
6480
key
6581
docCount
6682
}
83+
subjects {
84+
key
85+
docCount
86+
}
6787
}
6888
}
6989
}

test/vcr_cassettes/advanced.yml

Lines changed: 13 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/vcr_cassettes/advanced_all_spaces.yml

Lines changed: 13 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/vcr_cassettes/advanced_citation_asdf.yml

Lines changed: 13 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/vcr_cassettes/advanced_source_defaults_to_all.yml

Lines changed: 13 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/vcr_cassettes/advanced_source_limit_to_one_source.yml

Lines changed: 13 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/vcr_cassettes/advanced_source_limit_to_two_sources.yml

Lines changed: 13 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/vcr_cassettes/advanced_title_data.yml

Lines changed: 13 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/vcr_cassettes/data.yml

Lines changed: 13 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)