fix(autocomplete): fuzzy search not working if the search one was not enabled

This commit is contained in:
Elian Doran
2026-04-13 13:20:42 +03:00
parent 597c6eb15b
commit ead70ad394

View File

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