From 720396ab2ded9838ad8ba835d29e759e166f9be5 Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Wed, 29 Jul 2020 14:04:18 +0000 Subject: [PATCH] [Library|Trunk] add organization query restrictions for method numOfSearchOrganizations2 git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@59193 d315682c-612b-4755-9ff5-7f18f6832af3 --- services/searchOrganizations.service.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/services/searchOrganizations.service.ts b/services/searchOrganizations.service.ts index 6f4947de..8e8141c5 100644 --- a/services/searchOrganizations.service.ts +++ b/services/searchOrganizations.service.ts @@ -200,8 +200,16 @@ export class SearchOrganizationsService { numOfSearchOrganizations2(params: string, properties:EnvProperties, refineParams:string=null ):any { let url = properties.searchAPIURLLAst+"resources2/?format=json&size=0&type=organizations"; - if(params != "") { - url += "&query=" + params; + var basicQuery = "(reldatasourcecompatibilityid exact driver or reldatasourcecompatibilityid exact driver-openaire2.0 or " + + "reldatasourcecompatibilityid exact openaire2.0 or reldatasourcecompatibilityid exact openaire3.0 or reldatasourcecompatibilityid exact openaire4.0 or " + + "reldatasourcecompatibilityid exact openaire-cris_1.1 or " + + "reldatasourcecompatibilityid exact openaire2.0_data or reldatasourcecompatibilityid exact hostedBy or relproject=*)"; + + url += "&query="; + if(params!= null && params != '' ) { + url +=" ( "+basicQuery+ " ) " +" and (" + params + ")"; + }else{ + url +=" ( "+basicQuery+ " ) "; } if(refineParams!= null && refineParams != '' ) { url += refineParams;