diff --git a/src/public/app/services/note_autocomplete.js b/src/public/app/services/note_autocomplete.js index 5dbb25c03..118a5cd23 100644 --- a/src/public/app/services/note_autocomplete.js +++ b/src/public/app/services/note_autocomplete.js @@ -32,8 +32,7 @@ async function autocompleteSourceForCKEditor(queryText) { async function autocompleteSource(term, cb, options = {}) { const activeNoteId = appContext.tabManager.getActiveContextNoteId(); - let results = await server.get(`autocomplete?query=${encodeURIComponent(term)}&activeNoteId=${activeNoteId}`); - + let results = await server.get(`autocomplete?query=${encodeURIComponent(term)}&activeNoteId=${activeNoteId}&fastSearch=${options.fastSearch}`); if (term.trim().length >= 1 && options.allowCreatingNotes) { results = [ { @@ -103,6 +102,15 @@ function showRecentNotes($el) { $el.trigger(e); } +function fullTextSearch($el,options){ + const searchString = $el.autocomplete("val") + clearText($el); + options.fastSearch = false; + $el.autocomplete("val", searchString); + $el.autocomplete('open'); + options.fastSearch = true; +} + function initNoteAutocomplete($el, options) { if ($el.hasClass("note-autocomplete-input") || utils.isMobile()) { // clear any event listener added in previous invocation of this function @@ -123,10 +131,14 @@ function initNoteAutocomplete($el, options) { .addClass("input-group-text show-recent-notes-button bx bx-time") .prop("title", "Show recent notes"); + const $fullTextSearchButton = $("