fix: Negated quote query error

This commit is contained in:
Tom Moor
2022-11-28 09:01:03 -05:00
parent b5570a7587
commit a5e2ac6570

View File

@@ -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