Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(autocomplete): fuzzy search not working if the search one was not enabled
Elian Doranead70ad39411
diff --git a/apps/server/src/services/search/services/search.ts b/apps/server/src/services/search/services/search.tsindex 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: SearchloadNeededInfoFromDatabase();}- // 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 orderingif (searchContext.orderBy) {@@ -415,6 +409,12 @@ function findResultsWithQuery(query: string, searchContext: SearchContext): Searquery = 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) {