Search pages:skip query parameter if value is empty

This commit is contained in:
argirok 2021-11-18 12:42:12 +02:00
parent 23f9f2c768
commit f19f5e6367
1 changed files with 6 additions and 4 deletions

View File

@ -1019,10 +1019,12 @@ export class NewSearchPageComponent {
let filterOp: string = this.searchFieldsHelper.getFieldOperator(filterId);
// console.info(filterId, filterOp);
for (let value of values) {
countvalues++;
var paramId = this.fieldIdsMap[filterId].param;
// parameters+='&' + paramId+ '='+ value;//+"&" + this.fieldIdsMap[paramId].operator + "="+((countvalues == 1)?"and":"or");
fq += (fq.length > 0 ? " " + filterOp + " " : "") + filterId + " exact " + (value);
if(value && value.length > 0){
countvalues++;
var paramId = this.fieldIdsMap[filterId].param;
// parameters+='&' + paramId+ '='+ value;//+"&" + this.fieldIdsMap[paramId].operator + "="+((countvalues == 1)?"and":"or");
fq += (fq.length > 0 ? " " + filterOp + " " : "") + filterId + " exact " + (value);
}
}
if (countvalues > 0) {
fq = "&fq=" + StringUtils.URIEncode(fq);