diff --git a/app/graphql/types/aggregations_type.rb b/app/graphql/types/aggregations_type.rb index 9e34c41..c2ad14c 100644 --- a/app/graphql/types/aggregations_type.rb +++ b/app/graphql/types/aggregations_type.rb @@ -12,6 +12,7 @@ class AggregationsType < Types::BaseObject field :languages, [Types::AggregationCountType], null: true, description: 'Total search results by language' field :literary_form, [Types::AggregationCountType], null: true, description: 'Total search results by fiction or nonfiction' + field :publication_information, [Types::AggregationCountType], null: true, description: 'Total search results by publisher' field :source, [Types::AggregationCountType], null: true, description: 'Total search results by source record system' field :subjects, [Types::AggregationCountType], null: true, description: 'Total search results by subject term' diff --git a/app/graphql/types/query_type.rb b/app/graphql/types/query_type.rb index 771b514..3320510 100644 --- a/app/graphql/types/query_type.rb +++ b/app/graphql/types/query_type.rb @@ -152,6 +152,7 @@ def collapse_buckets(es_aggs) subjects: es_aggs['subjects']['subject_names']['buckets'], languages: es_aggs['languages']['buckets'], literary_form: es_aggs['literary_form']['buckets'], + publication_information: es_aggs['publication_information']['buckets'], format: es_aggs['content_format']['buckets'], content_type: es_aggs['content_type']['buckets'] } diff --git a/app/models/opensearch.rb b/app/models/opensearch.rb index 47a3a4e..7010587 100644 --- a/app/models/opensearch.rb +++ b/app/models/opensearch.rb @@ -280,6 +280,11 @@ def aggregations field: 'literary_form' } }, + publication_information: { + terms: { + field: 'publication_information' + } + }, source: { terms: { field: 'source'