From 6b907fe97d765773e2865c748a6edf9fe4c2b866 Mon Sep 17 00:00:00 2001 From: argirok Date: Wed, 13 Mar 2024 12:04:23 +0200 Subject: [PATCH] [develop | DONE | ADDED] add method for grouped count queries that goes through the cache --- services/searchResearchResults.service.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services/searchResearchResults.service.ts b/services/searchResearchResults.service.ts index 3e49a7cc..aadcd730 100644 --- a/services/searchResearchResults.service.ts +++ b/services/searchResearchResults.service.ts @@ -133,7 +133,14 @@ export class SearchResearchResultsService { return this.http.get((properties.useLongCache && size == 0 && !params && (!refineQuery || !refineQuery.includes("fq="))) ? (properties.cacheUrl + encodeURIComponent(url)) : url) .pipe(map(res => [res['meta'].total, this.parseResults(resultType, res['results'], properties), RefineResultsUtils.parse(res['refineResults'], refineFields, "publication")])); } + countResults(field:string,value:string): any { + let url = properties.utilsService + "/portals/countResults"; + if (field && value) { + url += "?field=" + encodeURIComponent(field) + "&value="+encodeURIComponent(value); + } + return this.http.get((properties.useLongCache ) ? (properties.cacheUrl + encodeURIComponent(url)) : url); + } searchResultForEntity(resultType: string, params: string, page: number, size: number, properties: EnvProperties): any { let link = properties.searchAPIURLLAst; //let url = link+params+"/"+this.getEntityQueryName(resultType,true)+ "?format=json";