Skip to content

Commit

Permalink
Add aggregation for publication_information
Browse files Browse the repository at this point in the history
This is the aggregation only. Adding the filter will come next.
  • Loading branch information
matt-bernhardt committed Feb 13, 2024
1 parent 2bead08 commit 0c13f22
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/graphql/types/aggregations_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
1 change: 1 addition & 0 deletions app/graphql/types/query_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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']
}
Expand Down
5 changes: 5 additions & 0 deletions app/models/opensearch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,11 @@ def aggregations
field: 'literary_form'
}
},
publication_information: {
terms: {
field: 'publication_information'
}
},
source: {
terms: {
field: 'source'
Expand Down

0 comments on commit 0c13f22

Please sign in to comment.