Skip to content

Commit 0db0233

Browse files
Add aggregation for publication_information
This is the aggregation only. Adding the filter will come next.
1 parent 83631de commit 0db0233

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

app/graphql/types/aggregations_type.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class AggregationsType < Types::BaseObject
1212
field :languages, [Types::AggregationCountType], null: true, description: 'Total search results by language'
1313
field :literary_form, [Types::AggregationCountType], null: true,
1414
description: 'Total search results by fiction or nonfiction'
15+
field :publication_information, [Types::AggregationCountType], null: true, description: 'Total search results by publisher'
1516
field :source, [Types::AggregationCountType], null: true,
1617
description: 'Total search results by source record system'
1718
field :subjects, [Types::AggregationCountType], null: true, description: 'Total search results by subject term'

app/graphql/types/query_type.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ def collapse_buckets(es_aggs)
152152
subjects: es_aggs['subjects']['subject_names']['buckets'],
153153
languages: es_aggs['languages']['buckets'],
154154
literary_form: es_aggs['literary_form']['buckets'],
155+
publication_information: es_aggs['publication_information']['buckets'],
155156
format: es_aggs['content_format']['buckets'],
156157
content_type: es_aggs['content_type']['buckets']
157158
}

app/models/opensearch.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,11 @@ def aggregations
240240
field: 'literary_form'
241241
}
242242
},
243+
publication_information: {
244+
terms: {
245+
field: 'publication_information'
246+
}
247+
},
243248
source: {
244249
terms: {
245250
field: 'source'

0 commit comments

Comments
 (0)