diff --git a/docs/backend_api/Note.html b/docs/backend_api/Note.html index f059e8d9b..6761aef35 100644 --- a/docs/backend_api/Note.html +++ b/docs/backend_api/Note.html @@ -93,7 +93,7 @@
Source:
@@ -267,7 +267,7 @@
Source:
@@ -335,7 +335,7 @@
Source:
@@ -406,7 +406,7 @@
Source:
@@ -474,7 +474,7 @@
Source:
@@ -542,7 +542,7 @@
Source:
@@ -610,7 +610,7 @@
Source:
@@ -678,7 +678,7 @@
Source:
@@ -746,7 +746,7 @@
Source:
@@ -814,7 +814,7 @@
Source:
@@ -882,7 +882,7 @@
Source:
@@ -950,7 +950,7 @@
Source:
@@ -1154,7 +1154,7 @@ See addLabel, addRelation for more specific methods.
Source:
@@ -1441,7 +1441,7 @@ See addLabel, addRelation for more specific methods.
Source:
@@ -1620,7 +1620,7 @@ returned.
Source:
@@ -1855,7 +1855,7 @@ returned.
Source:
@@ -2055,7 +2055,7 @@ returned.
Source:
@@ -2317,7 +2317,7 @@ returned.
Source:
@@ -2423,7 +2423,7 @@ returned.
Source:
@@ -2597,7 +2597,7 @@ returned.
Source:
@@ -2775,7 +2775,7 @@ returned.
Source:
@@ -2978,7 +2978,7 @@ returned.
Source:
@@ -3086,7 +3086,7 @@ returned.
Source:
@@ -3188,7 +3188,7 @@ returned.
Source:
@@ -3290,7 +3290,7 @@ returned.
Source:
@@ -3392,7 +3392,7 @@ returned.
Source:
@@ -3494,7 +3494,7 @@ returned.
Source:
@@ -3602,7 +3602,7 @@ returned.
Source:
@@ -3708,7 +3708,7 @@ returned.
Source:
@@ -3859,7 +3859,7 @@ returned.
Source:
@@ -4017,7 +4017,7 @@ returned.
Source:
@@ -4187,7 +4187,7 @@ returned.
Source:
@@ -4354,7 +4354,7 @@ returned.
Source:
@@ -4460,7 +4460,7 @@ returned.
Source:
@@ -4640,7 +4640,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -4876,7 +4876,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -5031,7 +5031,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -5189,7 +5189,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -5359,7 +5359,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -5526,7 +5526,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -5681,7 +5681,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -5839,7 +5839,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -6009,7 +6009,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -6115,7 +6115,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -6217,7 +6217,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -6457,7 +6457,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -6615,7 +6615,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -6785,7 +6785,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -6891,7 +6891,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -6952,6 +6952,108 @@ This method can be significantly faster than the getAttribute() +

getSearchResultNotes() → {Array.<Note>}

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Array.<Note> + + +
+
+ + + + + + + + + + + + +

getSubtree() → {Object}

@@ -7000,7 +7102,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -7102,7 +7204,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -7204,7 +7306,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -7306,7 +7408,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -7502,7 +7604,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -7712,7 +7814,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -7814,7 +7916,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -8008,7 +8110,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -8237,7 +8339,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -8435,7 +8537,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -8633,7 +8735,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -8831,7 +8933,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -8981,7 +9083,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -9087,7 +9189,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -9193,7 +9295,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -9299,7 +9401,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -9405,7 +9507,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -9511,7 +9613,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -9903,7 +10005,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
Source:
@@ -10083,7 +10185,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
Source:
@@ -10263,7 +10365,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
Source:
@@ -10458,7 +10560,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
Source:
@@ -10690,7 +10792,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
Source:
@@ -10870,7 +10972,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
Source:
@@ -11030,7 +11132,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
Source:
@@ -11272,7 +11374,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
Source:
@@ -11483,7 +11585,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
Source:
@@ -11694,7 +11796,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '
Source:
diff --git a/docs/backend_api/becca_entities_note.js.html b/docs/backend_api/becca_entities_note.js.html index f584efb8e..ac417b226 100644 --- a/docs/backend_api/becca_entities_note.js.html +++ b/docs/backend_api/becca_entities_note.js.html @@ -39,6 +39,7 @@ const NoteRevision = require("./note_revision"); const TaskContext = require("../../services/task_context"); const dayjs = require("dayjs"); const utc = require('dayjs/plugin/utc'); +const searchService = require("../../services/search/services/search.js"); dayjs.extend(utc) const LABEL = 'label'; @@ -867,6 +868,27 @@ class Note extends AbstractEntity { return Array.from(set); } + /** @return {Note[]} */ + getSearchResultNotes() { + if (this.type !== 'search') { + return []; + } + + try { + const searchService = require("../../services/search/services/search"); + const {searchResultNoteIds} = searchService.searchFromNote(this); + + const becca = this.becca; + return searchResultNoteIds + .map(resultNoteId => becca.notes[resultNoteId]) + .filter(note => !!note); + } + catch (e) { + log.error(`Could not resolve search note ${this.noteId}: ${e.message}`); + return []; + } + } + /** * @returns {{notes: Note[], relationships: Array.<{parentNoteId: string, childNoteId: string}>}} */ @@ -876,16 +898,8 @@ class Note extends AbstractEntity { function resolveSearchNote(searchNote) { try { - const searchService = require("../../services/search/services/search"); - const becca = searchNote.becca; - const {searchResultNoteIds} = searchService.searchFromNote(searchNote); - - for (const resultNoteId of searchResultNoteIds) { - const resultNote = becca.notes[resultNoteId]; - - if (resultNote) { - addSubtreeNotesInner(resultNote, searchNote); - } + for (const resultNote of searchNote.getSearchResultNotes()) { + addSubtreeNotesInner(resultNote, searchNote); } } catch (e) { diff --git a/docs/frontend_api/FrontendScriptApi.html b/docs/frontend_api/FrontendScriptApi.html index 105a352d3..025609d27 100644 --- a/docs/frontend_api/FrontendScriptApi.html +++ b/docs/frontend_api/FrontendScriptApi.html @@ -2103,7 +2103,7 @@ - + @@ -2350,13 +2350,6 @@ - - - - - - - @@ -2385,6 +2378,10 @@ + + + + custom link tile with note's title as default @@ -2393,6 +2390,13 @@ + + + + + + + diff --git a/docs/frontend_api/services_frontend_script_api.js.html b/docs/frontend_api/services_frontend_script_api.js.html index e47bb0eb5..27d8ffe88 100644 --- a/docs/frontend_api/services_frontend_script_api.js.html +++ b/docs/frontend_api/services_frontend_script_api.js.html @@ -381,7 +381,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain * @param {boolean} [params.showTooltip=true] - enable/disable tooltip on the link * @param {boolean} [params.showNotePath=false] - show also whole note's path as part of the link * @param {boolean} [params.showNoteIcon=false] - show also note icon before the title - * @param {string} [title=] - custom link tile with note's title as default + * @param {string} [params.title=] - custom link tile with note's title as default */ this.createNoteLink = linkService.createNoteLink;