From 9c6215139be70d47d805e82133d73e5950b0d7f4 Mon Sep 17 00:00:00 2001 From: IceSandwich Date: Thu, 17 Jul 2025 10:12:15 +0800 Subject: [PATCH] display actual candidate count when using fast search --- web/js/autocomplete.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/web/js/autocomplete.js b/web/js/autocomplete.js index 97c8781..dd1ad9f 100644 --- a/web/js/autocomplete.js +++ b/web/js/autocomplete.js @@ -112,11 +112,6 @@ function searchCompletionCandidates(textareaElement) { suggest: false, cache: true, }); - if (settingValues._logprocessingTime) { - const endTime = performance.now(); - const duration = endTime - startTime; - console.debug(`[Autocomplete-Plus] Fast Search for "${partialTag}" in ${source} took ${duration.toFixed(2)}ms. Found ${searchResults.length} candidates.`); - } let result = []; result = searchResults.map((index) => { @@ -144,6 +139,12 @@ function searchCompletionCandidates(textareaElement) { result = result.map((index) => { return autoCompleteData[source].sortedTags[index]; }); + + if (settingValues._logprocessingTime) { + const endTime = performance.now(); + const duration = endTime - startTime; + console.debug(`[Autocomplete-Plus] Fast Search for "${partialTag}" in ${source} took ${duration.toFixed(2)}ms. Found ${result.length} candidates within ${searchResults.length} searches with aliases.`); + } return result; } else { // Search in sortedTags (already sorted by count)