diff --git a/searchPages/searchProjects.component.ts b/searchPages/searchProjects.component.ts index 0cb29d90..2999a3a7 100644 --- a/searchPages/searchProjects.component.ts +++ b/searchPages/searchProjects.component.ts @@ -122,7 +122,7 @@ export class SearchProjectsComponent { this.searchPage.fieldIds = this.fieldIds; this.selectedFields = []; this.searchPage.prepareSearchPage(this.fieldIds, this.selectedFields, this.refineFields, this.rangeFields, this.fieldIdsMap,this.customFilter,params, "project"); - this.getResults(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), this.searchUtils.page, this.searchUtils.size, refine, this.searchPage.getSearchAPIQueryForRangeFields(params)+this.searchPage.getSearchAPIQueryForRefineFields(params, firstLoad), firstLoad); + this.getResults(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), this.searchUtils.page, this.searchUtils.size, refine, this.searchPage.getSearchAPIQueryForRangeFields(params)+this.searchPage.getSearchAPIQueryForRefineFields(params, firstLoad)); firstLoad = false; }); } @@ -130,7 +130,7 @@ export class SearchProjectsComponent { this.sub.unsubscribe(); } sub: any; - public getResults(parameters:string, page: number, size: number, refine: boolean, refineFieldsFilterQuery = null, firstLoad: boolean = true){ + public getResults(parameters:string, page: number, size: number, refine: boolean, refineFieldsFilterQuery = null){ if(page > this.pagingLimit) { size=0; } @@ -162,12 +162,10 @@ export class SearchProjectsComponent { // this.searchPage.updateBaseUrlWithParameters(); if (refine) { this.filters = this.searchPage.prepareFiltersToShow(data[2], this.searchUtils.totalResults); + this.rangeFilters = this.searchPage.prepareRangeFiltersToShow(); }else{ this.searchPage.buildPageURLParameters(this.filters, this.rangeFilters, false); } - if(firstLoad) { - this.rangeFilters = this.searchPage.prepareRangeFiltersToShow(); - } //var errorCodes:ErrorCodes = new ErrorCodes(); this.searchUtils.status = this.errorCodes.DONE; diff --git a/searchPages/searchResearchResults.component.ts b/searchPages/searchResearchResults.component.ts index 48be4845..735333cd 100644 --- a/searchPages/searchResearchResults.component.ts +++ b/searchPages/searchResearchResults.component.ts @@ -132,7 +132,7 @@ export class SearchResearchResultsComponent { } this.selectedFields = []; this.searchPage.prepareSearchPage(this.fieldIds, this.selectedFields, this.refineFields, this.rangeFields, this.fieldIdsMap,this.customFilter,params, this.resultType, this.quickFilter); - this._getResults(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy, refine, this.searchPage.getSearchAPIQueryForRangeFields(params)+this.searchPage.getSearchAPIQueryForRefineFields(params, firstLoad), firstLoad); + this._getResults(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy, refine, this.searchPage.getSearchAPIQueryForRangeFields(params)+this.searchPage.getSearchAPIQueryForRefineFields(params, firstLoad)); firstLoad = false; })); } @@ -143,7 +143,7 @@ export class SearchResearchResultsComponent { } } - public _getResults(parameters: string, page: number, size: number, sortBy: string, refine: boolean, refineFieldsFilterQuery = null, firstLoad: boolean = true) { + public _getResults(parameters: string, page: number, size: number, sortBy: string, refine: boolean, refineFieldsFilterQuery = null) { if (page > this.pagingLimit) { size = 0; } @@ -168,12 +168,10 @@ export class SearchResearchResultsComponent { this.results = data[1]; if (refine) { this.filters = this.searchPage.prepareFiltersToShow(data[2],this.searchUtils.totalResults); + this.rangeFilters = this.searchPage.prepareRangeFiltersToShow(); } else { this.searchPage.buildPageURLParameters(this.filters, this.rangeFilters, false); } - if(firstLoad) { - this.rangeFilters = this.searchPage.prepareRangeFiltersToShow(); - } this.searchUtils.status = this.errorCodes.DONE; if (this.searchUtils.totalResults == 0) {