Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix correct number of related attributes
zadam9ce224d4c5ba
diff --git a/src/routes/api/search.js b/src/routes/api/search.jsindex 9bdb28f3f4..aaafe27870 100644--- a/src/routes/api/search.js+++ b/src/routes/api/search.js@@ -247,6 +247,12 @@ function getRelatedNotes(req) {const allResults = matchingNameAndValue.concat(matchingName);+ const allResultNoteIds = new Set();++ for (const record of allResults) {+ allResultNoteIds.add(record.noteId);+ }+for (const record of allResults) {if (results.length >= 20) {break;@@ -260,7 +266,7 @@ function getRelatedNotes(req) {}return {- count: allResults.length,+ count: allResultNoteIds.size,results};}