mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 03:46:37 +01:00
quick search widget WIP
This commit is contained in:
@@ -200,6 +200,19 @@ async function searchFromRelation(note, relationName) {
|
||||
return typeof result[0] === 'string' ? result : result.map(item => item.noteId);
|
||||
}
|
||||
|
||||
function quickSearch(req) {
|
||||
const {searchString} = req.params;
|
||||
|
||||
const searchContext = new SearchContext({
|
||||
fastSearch: false,
|
||||
includeArchivedNotes: false,
|
||||
fuzzyAttributeSearch: false
|
||||
});
|
||||
|
||||
return searchService.findNotesWithQuery(searchString, searchContext)
|
||||
.map(sr => sr.noteId);
|
||||
}
|
||||
|
||||
function getRelatedNotes(req) {
|
||||
const attr = req.body;
|
||||
|
||||
@@ -276,5 +289,6 @@ function formatValue(val) {
|
||||
module.exports = {
|
||||
searchFromNote,
|
||||
searchAndExecute,
|
||||
getRelatedNotes
|
||||
getRelatedNotes,
|
||||
quickSearch
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user