caching initial noteset to improve search times

This commit is contained in:
zadam
2021-10-06 19:59:29 +02:00
parent 17fe9a6a1b
commit df8706026e
6 changed files with 40 additions and 12 deletions
+1 -7
View File
@@ -64,17 +64,11 @@ function loadNeededInfoFromDatabase() {
* @return {SearchResult[]}
*/
function findResultsWithExpression(expression, searchContext) {
let allNotes = Object.values(becca.notes);
if (searchContext.dbLoadNeeded) {
loadNeededInfoFromDatabase();
}
// in the process of loading data sometimes we create "skeleton" note instances which are expected to be filled later
// in case of inconsistent data this might not work and search will then crash on these
allNotes = allNotes.filter(note => note.type !== undefined);
const allNoteSet = new NoteSet(allNotes);
const allNoteSet = becca.getAllNoteSet();
const executionContext = {
noteIdToNotePath: {}