feat: filter and search by tag
This commit is contained in:
@ -155,7 +155,13 @@ func (s *SQLiteStorage) Search(query string) []*note.Note {
|
||||
SELECT id, path, title, content, updated_at, size, published
|
||||
FROM notes
|
||||
WHERE lower(content) LIKE lower(?)
|
||||
`, pattern)
|
||||
OR id IN (
|
||||
SELECT nt.note_id
|
||||
FROM note_tags nt
|
||||
JOIN tags t ON t.id = nt.tag_id
|
||||
WHERE lower(t.name) LIKE lower(?)
|
||||
)
|
||||
`, pattern, pattern)
|
||||
if err != nil {
|
||||
return []*note.Note{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user