From 00868405c8f460a2525d53ff3f45d1e67f8ad215 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Wed, 31 Aug 2022 12:55:09 +0300 Subject: [PATCH] Refix parenthesis in search --- searchPages/searchUtils/newSearchPage.component.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/searchPages/searchUtils/newSearchPage.component.ts b/searchPages/searchUtils/newSearchPage.component.ts index 00d181e9..2605c255 100644 --- a/searchPages/searchUtils/newSearchPage.component.ts +++ b/searchPages/searchUtils/newSearchPage.component.ts @@ -909,7 +909,6 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges { //TODO deposit case // console.log(this.usedBy) // console.log(this.keywordFields) - if (this.usedBy == "deposit") { if (this.keywordFields.length > 0) { @@ -939,7 +938,6 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges { params += NewSearchPageComponent.createQuotedKeywordQuery(this.selectedFields[i].value, this.selectedFields[i].id, this.selectedFields[i].operatorId, countParams, false); } else { params += (countParams == 0 ? "" : " " + this.selectedFields[i].operatorId + " ") + this.selectedFields[i].id + this.fieldIdsMap[this.selectedFields[i].id].equalityOperator + '"' + encodeURIComponent(this.selectedFields[i].value) + '"' + " "; - } } countParams++; @@ -991,7 +989,7 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges { } else { //if it is PIDs but no doisquery produced, forced to use quotes as the query will fail due to special characters params += this.createQuotedKeywordQuery(value, id, operatorId, countParams, true, - (DOIs.length > 0 && doisParams.length == 0), includes) + ")"; + (DOIs.length > 0 && doisParams.length == 0), includes); } return params; @@ -1014,7 +1012,7 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges { if (forceQuotted) { /** Remove double quotes **/ fieldValue = fieldValue.replace(/["]+/g, ''); - return params + this.getQuotedQueryPart(fieldId, '"' + fieldValue + '"', isSearchAll); + return params + this.getQuotedQueryPart(fieldId, '"' + fieldValue + '"', isSearchAll) + ")"; } if (quotedParts && quotedParts.length == 1 && quotedParts[0] == fieldValue) { params += this.getQuotedQueryPart(fieldId, fieldValue, isSearchAll);