Add full text search in autocomplete

This commit is contained in:
SiriusXT 2024-11-26 16:20:38 +08:00
parent 0d9e13c1e0
commit e877ad68cf

View File

@ -30,6 +30,15 @@ async function autocompleteSourceForCKEditor(queryText) {
}
async function autocompleteSource(term, cb, options = {}, fastSearch = true) {
if (fastSearch === false) {
cb(
[{
noteTitle: term,
highlightedNotePathTitle: `Searching...`
}]
);
}
const activeNoteId = appContext.tabManager.getActiveContextNoteId();
let results = await server.get(`autocomplete?query=${encodeURIComponent(term)}&activeNoteId=${activeNoteId}&fastSearch=${fastSearch}`);