mirror of
https://github.com/zadam/trilium.git
synced 2025-11-11 07:45:51 +01:00
custom implementation of similar notes algorithm
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"use strict";
|
||||
|
||||
const noteCacheService = require('../../services/note_cache/note_cache_service');
|
||||
const similarityService = require('../../services/note_cache/similarity.js');
|
||||
const repository = require('../../services/repository');
|
||||
|
||||
async function getSimilarNotes(req) {
|
||||
@@ -12,10 +12,7 @@ async function getSimilarNotes(req) {
|
||||
return [404, `Note ${noteId} not found.`];
|
||||
}
|
||||
|
||||
const results = await noteCacheService.findSimilarNotes(noteId);
|
||||
|
||||
return results
|
||||
.filter(note => note.noteId !== noteId);
|
||||
return await similarityService.findSimilarNotes(noteId);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
||||
Reference in New Issue
Block a user