@@ -467,12 +467,11 @@ export default {
467467 }, 500 )
468468 },
469469 search (query , tree ) {
470- return Object .values (tree .index .bookmark )
470+ return Object .values (tree .index .folder )
471471 .filter (item => {
472472 const matchTitleFully = item .title ? query .split (' ' ).every (term => item .title .toLowerCase ().split (' ' ).some (word => word === term)) : false
473473 const matchTitlePartially = item .title ? query .split (' ' ).every (term => item .title .toLowerCase ().includes (term)) : false
474- const matchUrl = query .split (' ' ).every (term => item .url .toLowerCase ().includes (term))
475- return matchUrl || matchTitleFully || matchTitlePartially
474+ return matchTitleFully || matchTitlePartially
476475 })
477476 .sort ((a , b ) => {
478477 const matchTitlePartiallyA = a .title ? query .split (' ' ).every (term => a .title .toLowerCase ().includes (term)) : false
@@ -483,7 +482,25 @@ export default {
483482 const matchTitleA = a .title ? query .split (' ' ).every (term => a .title .toLowerCase ().split (' ' ).some (word => word === term)) : false
484483 const matchTitleB = b .title ? query .split (' ' ).every (term => b .title .toLowerCase ().split (' ' ).some (word => word === term)) : false
485484 return matchTitleA ? (matchTitleB ? 0 : - 1 ) : 1
486- })
485+ }).concat (
486+ Object .values (tree .index .bookmark )
487+ .filter (item => {
488+ const matchTitleFully = item .title ? query .split (' ' ).every (term => item .title .toLowerCase ().split (' ' ).some (word => word === term)) : false
489+ const matchTitlePartially = item .title ? query .split (' ' ).every (term => item .title .toLowerCase ().includes (term)) : false
490+ const matchUrl = query .split (' ' ).every (term => item .url .toLowerCase ().includes (term))
491+ return matchUrl || matchTitleFully || matchTitlePartially
492+ })
493+ .sort ((a , b ) => {
494+ const matchTitlePartiallyA = a .title ? query .split (' ' ).every (term => a .title .toLowerCase ().includes (term)) : false
495+ const matchTitlePartiallyB = b .title ? query .split (' ' ).every (term => b .title .toLowerCase ().includes (term)) : false
496+ return matchTitlePartiallyA ? (matchTitlePartiallyB ? 0 : - 1 ) : 1
497+ })
498+ .sort ((a , b ) => {
499+ const matchTitleA = a .title ? query .split (' ' ).every (term => a .title .toLowerCase ().split (' ' ).some (word => word === term)) : false
500+ const matchTitleB = b .title ? query .split (' ' ).every (term => b .title .toLowerCase ().split (' ' ).some (word => word === term)) : false
501+ return matchTitleA ? (matchTitleB ? 0 : - 1 ) : 1
502+ })
503+ )
487504 },
488505 goBack () {
489506 if (this .isAddingBookmark ) {
0 commit comments