From c666fc3b981d4aade0c7e6d38a4a3c6fda3c46bc Mon Sep 17 00:00:00 2001 From: zadam Date: Wed, 18 Oct 2023 09:33:24 +0200 Subject: [PATCH] make sure exact noteId match comes on the top in search --- src/services/search/search_result.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/services/search/search_result.js b/src/services/search/search_result.js index 4c678661d..ca3811f8e 100644 --- a/src/services/search/search_result.js +++ b/src/services/search/search_result.js @@ -22,6 +22,10 @@ class SearchResult { const note = becca.notes[this.noteId]; + if (note.noteId.toLowerCase() === fulltextQuery) { + this.score += 100; + } + if (note.title.toLowerCase() === fulltextQuery) { this.score += 100; // high reward for exact match #3470 }