Skip to content

Commit

Permalink
added missing aggregation in model
Browse files Browse the repository at this point in the history
  • Loading branch information
kjgarza committed Sep 27, 2021
1 parent 14b6837 commit 1891757
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/models/doi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,7 @@ def self.gql_query_aggregations(facet_count: 10)
if facet_count.positive?
{
resource_types: { terms: { field: "resource_type_id_and_name", size: facet_count, min_doc_count: 1 } },
clients: { terms: { field: "client_id_and_name", size: facet_count, min_doc_count: 1 } },
open_licenses: {
filter: { terms: { "rights_list.rightsIdentifier": ["cc-by-1.0", "cc-by-2.0", "cc-by-2.5", "cc-by-3.0", "cc-by-3.0-at", "cc-by-3.0-us", "cc-by-4.0", "cc-pddc", "cc0-1.0", "cc-pdm-1.0"] } },
aggs: {
Expand Down
8 changes: 8 additions & 0 deletions spec/graphql/types/work_type_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,11 @@
title
count
}
repositories {
id
title
count
}
languages {
id
title
Expand Down Expand Up @@ -646,6 +651,9 @@
expect(response.dig("data", "works", "registrationAgencies")).to eq(
[{ "count" => 10, "id" => "datacite", "title" => "DataCite" }],
)
expect(response.dig("data", "works", "repositories").first).to eq(
{ "count" => 1, "id" => "testa.test1", "title" => "My data center" },
)
expect(response.dig("data", "works", "languages")).to eq(
[{ "count" => 10, "id" => "nl", "title" => "Dutch" }],
)
Expand Down

0 comments on commit 1891757

Please sign in to comment.