zadam / trilium

Build your personal knowledge base with Trilium Notes
GNU Affero General Public License v3.0
27.2k stars 1.9k forks source link

(Feature request) Auto-visualizing notes returned by a search query #3262

Open agentydragon opened 1 year ago

agentydragon commented 1 year ago

Describe feature

Allow user write a search query and have its search result automatically visualized - only the returned notes, not also their children.

That is the thing I'm trying to do and having problems doing with Trilium right now. Below I describe why I want this, and some ways I propose this could be implemented.

My problem

I would like to have a visualization of all my issues and issue hotlists (i.e., #issue OR #hotlist search query results).

some of my issues contain notes that are not themselves issues. If issue "call John" contains "John" as a subpage, I don't want John included in the visualization.

I ideally do not want to have to manually add all of those nodes. I want the visualization to auto-update as I create new issues, etc.

I just tried using a note map for this (https://github.com/zadam/trilium/wiki/Note-map).

I also tried a relation map.

some ideas for options that would help me here:

Additional Information

No response

agentydragon commented 1 year ago

I think the root of my problem with note map for this purpose would be best addressed by https://github.com/zadam/trilium/issues/3263 - the Trilium having one privileged tree structure.

agentydragon commented 1 year ago

It also looks like the relation map has a relation to nodes included on it, but I could only see the relation when trying to delete a node on the map - I didn't see that relation either on the relation map's owned attributes, or the displayed note's owned attributes. So I suspect it might work like the "internalLink" relation and be just automatically generated from the content of the map note's markup.

agentydragon commented 1 year ago

looks like the relation map is JSON. I could write a piece of Trilium JS to run a search query and generate this JSON from the results.

image

so if I generated the JSON and then could click a "relayout" button to lay the graph out reasonably, that would help. it would be nice if there were such a button in relation map view, but worst-case I could just lay the graph out myself.

zadam commented 1 year ago

I added some improvements to the note map implementation to work on search notes - it's available through ribbon tab or created as a "note map" note with #mapRootNoteId pointing to the search note:

image