feat(quick_search): also try to show the "matched" text in quick search results and not just note titles

This commit is contained in:
perf3ct
2025-08-03 00:29:21 +00:00
parent c436455b32
commit 51a8937c64
2 changed files with 86 additions and 30 deletions

View File

@@ -52,10 +52,15 @@ function quickSearch(req: Request) {
fuzzyAttributeSearch: false
});
const resultNoteIds = searchService.findResultsWithQuery(searchString, searchContext).map((sr) => sr.noteId);
// Use the same highlighting logic as autocomplete for consistency
const searchResults = searchService.searchNotesForAutocomplete(searchString, false);
// Extract note IDs for backward compatibility
const resultNoteIds = searchResults.map((result) => result.notePath.split("/").pop()).filter(Boolean) as string[];
return {
searchResultNoteIds: resultNoteIds,
searchResults: searchResults,
error: searchContext.getError()
};
}