From 14b80fb1c3a41ea04c484ea3f76a4ea2ea1c737d Mon Sep 17 00:00:00 2001 From: argirok Date: Fri, 15 Apr 2022 16:59:41 +0300 Subject: [PATCH] update query for datasources (registries, journals, etc) --- .../searchUtils/datasourcesHelper.class.ts | 27 +++---------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/searchPages/searchUtils/datasourcesHelper.class.ts b/searchPages/searchUtils/datasourcesHelper.class.ts index ce949974..368fa0ab 100644 --- a/searchPages/searchUtils/datasourcesHelper.class.ts +++ b/searchPages/searchUtils/datasourcesHelper.class.ts @@ -43,37 +43,18 @@ export class DatasourcesHelperClass { } } public static getQueryPrefix(type: "all" | "registries" | "journals" | "compatible" | "deposit"): string { - if(properties.environment == "production") { if (type == "registries") { - return ' (datasourcetypeuiid = "entityregistry" or datasourcetypeuiid = "entityregistry::products" or datasourcetypeuiid = "entityregistry::repositories" ' + - 'or datasourcetypeuiid = "entityregistry::organizations" or datasourcetypeuiid = "entityregistry::researchers" ) '; - + return 'datasourcetypeuiname exact "Registry"'; } else if (type == "journals") { // return ' not(datasourcecompatibilityid = UNKNOWN) not(datasourcecompatibilityid = notCompatible) and (datasourcetypeuiid exact "pubsrepository::journal" or datasourcetypeuiid exact "aggregator::pubsrepository::journals" ) '; - return 'oaftype exact datasource not datasourcecompatibilityid = notCompatible and (datasourcetypeuiid exact "pubsrepository::journal" or datasourcetypeuiid exact "aggregator::pubsrepository::journals" ) '; - + return 'oaftype exact datasource not datasourcecompatibilityid = notCompatible and datasourcetypeuiname exact "Journal archive" '; } else if (type == "compatible") { - return ' oaftype exact datasource and datasourcecompatibilityid <> notCompatible and datasourcetypeuiid <> other and datasourcetypeuiid <> "pubsrepository::journal" and datasourcetypeuiid <> "aggregator::pubsrepository::journals" '; + return ' oaftype exact datasource and datasourcecompatibilityid <> notCompatible and datasourcetypeuiname exact "Repository" '; }else if (type == "deposit") { - return ' oaftype exact datasource '; + return ' oaftype exact datasource and (datasourcetypeuiname exact "Journal archive" or datasourcetypeuiname exact "Repository")'; } else { return ""; } - }else{ - if (type == "registries") { - return 'datasourcetypeuiname exact "Registry"'; - } else if (type == "journals") { - // return ' not(datasourcecompatibilityid = UNKNOWN) not(datasourcecompatibilityid = notCompatible) and (datasourcetypeuiid exact "pubsrepository::journal" or datasourcetypeuiid exact "aggregator::pubsrepository::journals" ) '; - return 'oaftype exact datasource not datasourcecompatibilityid = notCompatible and datasourcetypeuiname exact "Journal archive" '; - - } else if (type == "compatible") { - return ' oaftype exact datasource and datasourcecompatibilityid <> notCompatible and datasourcetypeuiname exact "Repository" '; - }else if (type == "deposit") { - return ' oaftype exact datasource and (datasourcetypeuiname exact "Journal archive" or datasourcetypeuiname exact "Repository")'; - } else { - return ""; - } - } } public static createFilters(type: "all" | "registries" | "journals" | "compatible" | "deposit"): Filter[] {