[develop | DONE | CHANGED]: refineFieldResults.service.ts & searchDataproviders.service.ts & searchOrganizations.service.ts & searchProjects.service.ts & searchResearchResults.service.ts: Set cache for default refine queries (without keywords or filters) - not in deposit and datasource specific pages.
This commit is contained in:
parent
f55107b8d5
commit
a7294685fb
|
@ -57,7 +57,8 @@ export class RefineFieldResultsService {
|
||||||
getField (link:string,fieldName:string, properties:EnvProperties):any{
|
getField (link:string,fieldName:string, properties:EnvProperties):any{
|
||||||
let url = link+"&refine=true&page=1&size=0";
|
let url = link+"&refine=true&page=1&size=0";
|
||||||
|
|
||||||
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
// return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
||||||
|
return this.http.get((properties.useLongCache && link.includes("sf=") && !link.includes("fq="))? (properties.cacheUrl+encodeURIComponent(url)): url)
|
||||||
//.map(res => <any> res.json())
|
//.map(res => <any> res.json())
|
||||||
.pipe(map(res => res['refineResults']))
|
.pipe(map(res => res['refineResults']))
|
||||||
.pipe(map(res => this.parse(res,fieldName)));
|
.pipe(map(res => this.parse(res,fieldName)));
|
||||||
|
|
|
@ -47,7 +47,8 @@ export class SearchDataprovidersService {
|
||||||
url += "&page="+(page-1)+"&size="+size;
|
url += "&page="+(page-1)+"&size="+size;
|
||||||
url += minRef ? "&minRef=true" : "";
|
url += minRef ? "&minRef=true" : "";
|
||||||
|
|
||||||
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
// return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
||||||
|
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(res['results']), RefineResultsUtils.parse(res['refineResults'],refineFields, "datasource")]));
|
.pipe(map(res => [res['meta'].total, this.parseResults(res['results']), RefineResultsUtils.parse(res['refineResults'],refineFields, "datasource")]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,8 @@ export class SearchOrganizationsService {
|
||||||
url += "&page="+(page-1)+"&size="+size;
|
url += "&page="+(page-1)+"&size="+size;
|
||||||
url += minRef ? "&minRef=true" : "";
|
url += minRef ? "&minRef=true" : "";
|
||||||
|
|
||||||
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
// return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
||||||
|
return this.http.get((properties.useLongCache && size == 0 && !params && (!refineQuery || !refineQuery.includes("fq="))) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
|
||||||
//.map(res => <any> res.json())
|
//.map(res => <any> res.json())
|
||||||
|
|
||||||
.pipe(map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "organization")]));
|
.pipe(map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "organization")]));
|
||||||
|
|
|
@ -70,7 +70,8 @@ export class SearchProjectsService {
|
||||||
url += minRef ? "&minRef=true" : "";
|
url += minRef ? "&minRef=true" : "";
|
||||||
|
|
||||||
// url += "&format=json";
|
// url += "&format=json";
|
||||||
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
// return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
||||||
|
return this.http.get((properties.useLongCache && size == 0 && !params && (!refineQuery || !refineQuery.includes("fq="))) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
|
||||||
//.map(res => <any> res.json())
|
//.map(res => <any> res.json())
|
||||||
.pipe(map(res => [res['meta'].total, this.parseResults(res['results']), RefineResultsUtils.parse(res['refineResults'],refineFields, "project")]));
|
.pipe(map(res => [res['meta'].total, this.parseResults(res['results']), RefineResultsUtils.parse(res['refineResults'],refineFields, "project")]));
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,7 +129,8 @@ export class SearchResearchResultsService {
|
||||||
url += minRef ? "&minRef=true" : "";
|
url += minRef ? "&minRef=true" : "";
|
||||||
// url += "&format=json";
|
// url += "&format=json";
|
||||||
|
|
||||||
return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
|
// return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
|
||||||
|
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")]));
|
.pipe(map(res => [res['meta'].total, this.parseResults(resultType, res['results'], properties), RefineResultsUtils.parse(res['refineResults'], refineFields, "publication")]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue