From e06c884aaf846e2009cb64e5807f5ec4a337f87d Mon Sep 17 00:00:00 2001 From: Sarala Wimalaratne Date: Wed, 22 Apr 2020 13:55:12 +0100 Subject: [PATCH 1/2] Trimmed link checking --- app/controllers/dois_controller.rb | 20 ++++++++++---------- app/models/doi.rb | 10 +++++----- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/app/controllers/dois_controller.rb b/app/controllers/dois_controller.rb index 039a37a30..e49d00c1d 100644 --- a/app/controllers/dois_controller.rb +++ b/app/controllers/dois_controller.rb @@ -168,11 +168,11 @@ def index certificates = total.positive? ? facet_by_key(response.aggregations.certificates.buckets) : nil link_checks_status = total.positive? ? facet_by_cumulative_year(response.aggregations.link_checks_status.buckets) : nil - links_with_schema_org = total.positive? ? facet_by_cumulative_year(response.aggregations.link_checks_has_schema_org.buckets) : nil - link_checks_schema_org_id = total.positive? ? response.aggregations.link_checks_schema_org_id.value : nil - link_checks_dc_identifier = total.positive? ? response.aggregations.link_checks_dc_identifier.value : nil - link_checks_citation_doi = total.positive? ? response.aggregations.link_checks_citation_doi.value : nil - links_checked = total.positive? ? response.aggregations.links_checked.value : nil + # links_with_schema_org = total.positive? ? facet_by_cumulative_year(response.aggregations.link_checks_has_schema_org.buckets) : nil + # link_checks_schema_org_id = total.positive? ? response.aggregations.link_checks_schema_org_id.value : nil + # link_checks_dc_identifier = total.positive? ? response.aggregations.link_checks_dc_identifier.value : nil + # link_checks_citation_doi = total.positive? ? response.aggregations.link_checks_citation_doi.value : nil + # links_checked = total.positive? ? response.aggregations.links_checked.value : nil citations = total.positive? ? metric_facet_by_year(response.aggregations.citations.buckets) : nil views = total.positive? ? metric_facet_by_year(response.aggregations.views.buckets) : nil @@ -198,11 +198,11 @@ def index "schemaVersions" => schema_versions, sources: sources, "linkChecksStatus" => link_checks_status, - "linksChecked" => links_checked, - "linksWithSchemaOrg" => links_with_schema_org, - "linkChecksSchemaOrgId" => link_checks_schema_org_id, - "linkChecksDcIdentifier" => link_checks_dc_identifier, - "linkChecksCitationDoi" => link_checks_citation_doi, + # "linksChecked" => links_checked, + # "linksWithSchemaOrg" => links_with_schema_org, + # "linkChecksSchemaOrgId" => link_checks_schema_org_id, + # "linkChecksDcIdentifier" => link_checks_dc_identifier, + # "linkChecksCitationDoi" => link_checks_citation_doi, subjects: subjects, citations: citations, views: views, diff --git a/app/models/doi.rb b/app/models/doi.rb index a3226a8dc..e35175035 100644 --- a/app/models/doi.rb +++ b/app/models/doi.rb @@ -567,11 +567,11 @@ def self.query_aggregations prefixes: { terms: { field: 'prefix', size: 15, min_doc_count: 1 } }, schema_versions: { terms: { field: 'schema_version', size: 15, min_doc_count: 1 } }, link_checks_status: { terms: { field: 'landing_page.status', size: 15, min_doc_count: 1 } }, - link_checks_has_schema_org: { terms: { field: 'landing_page.hasSchemaOrg', size: 2, min_doc_count: 1 } }, - link_checks_schema_org_id: { value_count: { field: "landing_page.schemaOrgId" } }, - link_checks_dc_identifier: { value_count: { field: "landing_page.dcIdentifier" } }, - link_checks_citation_doi: { value_count: { field: "landing_page.citationDoi" } }, - links_checked: { value_count: { field: "landing_page.checked" } }, + # link_checks_has_schema_org: { terms: { field: 'landing_page.hasSchemaOrg', size: 2, min_doc_count: 1 } }, + # link_checks_schema_org_id: { value_count: { field: "landing_page.schemaOrgId" } }, + # link_checks_dc_identifier: { value_count: { field: "landing_page.dcIdentifier" } }, + # link_checks_citation_doi: { value_count: { field: "landing_page.citationDoi" } }, + # links_checked: { value_count: { field: "landing_page.checked" } }, sources: { terms: { field: 'source', size: 15, min_doc_count: 1 } }, subjects: { terms: { field: 'subjects.subject', size: 15, min_doc_count: 1 } }, certificates: { terms: { field: 'client.certificate', size: 15, min_doc_count: 1 } }, From f54465015f1f2cafe2108e558a94e26806f4a319 Mon Sep 17 00:00:00 2001 From: Sarala Wimalaratne Date: Thu, 23 Apr 2020 05:54:02 +0100 Subject: [PATCH 2/2] subject and source removed from the api This has breaking changes for fabrica --- app/controllers/dois_controller.rb | 8 ++++---- app/models/doi.rb | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/dois_controller.rb b/app/controllers/dois_controller.rb index 80042a937..fac859e7c 100644 --- a/app/controllers/dois_controller.rb +++ b/app/controllers/dois_controller.rb @@ -163,8 +163,8 @@ def index schema_versions = total.positive? ? facet_by_schema(response.aggregations.schema_versions.buckets) : nil affiliations = total.positive? ? facet_by_combined_key(response.aggregations.affiliations.buckets) : nil - sources = total.positive? ? facet_by_key(response.aggregations.sources.buckets) : nil - subjects = total.positive? ? facet_by_key(response.aggregations.subjects.buckets) : nil + # sources = total.positive? ? facet_by_key(response.aggregations.sources.buckets) : nil + # subjects = total.positive? ? facet_by_key(response.aggregations.subjects.buckets) : nil certificates = total.positive? ? facet_by_key(response.aggregations.certificates.buckets) : nil link_checks_status = total.positive? ? facet_by_cumulative_year(response.aggregations.link_checks_status.buckets) : nil @@ -196,14 +196,14 @@ def index prefixes: prefixes, certificates: certificates, "schemaVersions" => schema_versions, - sources: sources, + # sources: sources, "linkChecksStatus" => link_checks_status, # "linksChecked" => links_checked, # "linksWithSchemaOrg" => links_with_schema_org, # "linkChecksSchemaOrgId" => link_checks_schema_org_id, # "linkChecksDcIdentifier" => link_checks_dc_identifier, # "linkChecksCitationDoi" => link_checks_citation_doi, - subjects: subjects, + # subjects: subjects, citations: citations, views: views, downloads: downloads, diff --git a/app/models/doi.rb b/app/models/doi.rb index e35175035..fc0a744d8 100644 --- a/app/models/doi.rb +++ b/app/models/doi.rb @@ -572,8 +572,8 @@ def self.query_aggregations # link_checks_dc_identifier: { value_count: { field: "landing_page.dcIdentifier" } }, # link_checks_citation_doi: { value_count: { field: "landing_page.citationDoi" } }, # links_checked: { value_count: { field: "landing_page.checked" } }, - sources: { terms: { field: 'source', size: 15, min_doc_count: 1 } }, - subjects: { terms: { field: 'subjects.subject', size: 15, min_doc_count: 1 } }, + # sources: { terms: { field: 'source', size: 15, min_doc_count: 1 } }, + # subjects: { terms: { field: 'subjects.subject', size: 15, min_doc_count: 1 } }, certificates: { terms: { field: 'client.certificate', size: 15, min_doc_count: 1 } }, views: { date_histogram: { field: 'publication_year', interval: 'year', format: 'year', order: { _key: "desc" }, min_doc_count: 1 },