From ead70ad39411248fc020c24d0d46f0308745a3ba Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 13 Apr 2026 13:20:42 +0300 Subject: [PATCH] fix(autocomplete): fuzzy search not working if the search one was not enabled --- apps/server/src/services/search/services/search.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/server/src/services/search/services/search.ts b/apps/server/src/services/search/services/search.ts index f9581aa170..ea1d20c263 100644 --- a/apps/server/src/services/search/services/search.ts +++ b/apps/server/src/services/search/services/search.ts @@ -236,12 +236,6 @@ function findResultsWithExpression(expression: Expression, searchContext: Search loadNeededInfoFromDatabase(); } - // For autocomplete searches, use the dedicated autocomplete fuzzy option - // instead of the global fuzzy setting. - if (searchContext.autocomplete) { - searchContext.enableFuzzyMatching = optionService.getOptionBool("searchAutocompleteFuzzy"); - } - // If there's an explicit orderBy clause, skip progressive search // as it would interfere with the ordering if (searchContext.orderBy) { @@ -415,6 +409,12 @@ function findResultsWithQuery(query: string, searchContext: SearchContext): Sear query = query || ""; searchContext.originalQuery = query; + // For autocomplete searches, use the dedicated autocomplete fuzzy option + // instead of the global fuzzy setting. Do this early so it applies to all code paths. + if (searchContext.autocomplete) { + searchContext.enableFuzzyMatching = optionService.getOptionBool("searchAutocompleteFuzzy"); + } + const expression = parseQueryToExpression(query, searchContext); if (!expression) {