From a5e2ac6570f6ab78795cdc4517b05103071f4f8c Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Mon, 28 Nov 2022 09:01:03 -0500 Subject: [PATCH] fix: Negated quote query error --- server/models/helpers/SearchHelper.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/models/helpers/SearchHelper.ts b/server/models/helpers/SearchHelper.ts index c72ecf3b4..fc118dd16 100644 --- a/server/models/helpers/SearchHelper.ts +++ b/server/models/helpers/SearchHelper.ts @@ -318,7 +318,9 @@ export default class SearchHelper { // if the search term is one unquoted word then allow partial matches automatically const queryWordCount = limitedQuery.split(" ").length; const singleUnquotedSearch = - queryWordCount === 1 && !limitedQuery.startsWith('"'); + queryWordCount === 1 && + !limitedQuery.startsWith('"') && + !limitedQuery.endsWith('"'); return queryParser({ singleQuoteReplacement: "&" })( singleUnquotedSearch ? `${limitedQuery}*` : limitedQuery