dendronhq / dendron

The personal knowledge management (PKM) tool that grows as you do!
https://wiki.dendron.so
Apache License 2.0
6.65k stars 252 forks source link

Advanced Queries #159

Open kevinslin opened 4 years ago

kevinslin commented 4 years ago

Context

Currently, you can find notes using the below methods in Dendron:

This covers many use cases but sometimes you will want more powerful searching capabilities.

Proposal

Support advanced query logic for Dendron that supports searching notes by the following fields

It should also support the following logical operators:

Questions

  1. Should the query be accessed via regular lookup or a dedicated search panel as a treeview?

Kevin's thoughts: start off as a dedicated treeview panel and look into enabling it via regular lookup using a | delimeter at some future date

kevinslin commented 3 years ago

Related to #394

hikchoi commented 3 years ago

Just echoing the discussion in Discord for the sake of preserving it.


hikchoi Yesterday at 7:36 PM does anyone feel the need to query leaf node? it just dawned on me that sometimes I get an idea and make a note with the intention of working on it later, but I forget about it :sweat_smile: either because I'm just busy and/or I'm lazy. These notes tend to be leaf notes as I haven't worked on the content of the notes yet, and have no children.

I thought it would be great to have a list view or some way to query leaf nodes that were created but untouched. I suppose you could have a tag inserted to a note that you want to visit later, and use the backlinks pane to list it, but I still have a bit of resistance to using tags for things. I feel like tags tend to proliferate and become a mess after a certain point (maybe I'm using it wrong haha).

I checked the issues on the dendron repo and it seems like frontmatter queries are in the works. I guess this could be solved by querying notes that have the same updated and created timestamp (or any given difference.)

right now I have a single list of todos called actionables (items that I can take action, not to be confused with legally actionable ), and I have a bunch of todo items that are "work on note X", and it's not working very well for me.



kevins8 Today at 1:15 AM yeah, leaf nodes are what i end up going to the most, especially with scratch notes. i've been experimenting with implementing queries a few weeks back but put that on hold for publishing. looking to getting back to that this month.

meanwhile, what sort of queries would be helpful for you? updated == created is what i'm gathering :slight_smile:


SR-- commented 3 years ago

These plans look good. Can we also have the search options that:

  1. allow the user to find instances of one word within a certain word distance from another? E.g., in dtSearch you do smith w/15 john to find all instances of 'smith' within 15-word distance from 'john'.
  2. allows finding notes with images based on parameters such as: number, size of image files, image metadata.

Thanks for considering...

techieshark commented 2 years ago

This - advanced querying - seems like one of the features where LogSeq shines (though I haven't used it extensively).

https://logseq.github.io/#/page/advanced%20queries

even their basic querying seems fairly powerful - https://logseq.github.io/#/page/queries

In case it helps:

The database that Logseq use is Datascript, which is an immutable in-memory database and Datalog query engine in Clojure and ClojureScript.

I love that Dendron is using the editor I'm already using often though, so it'd be great to see some of this LogSeq-style functionality in Dendron, if there's a place for it?

SR-- commented 2 years ago
  1. It would be good if one could save queries that could auto-update.
  2. It would be even better if one could then run some analysis on the results, such as file/text stats, display them as a graph, etc.
  3. Also, to extend the request for extra operators already mentioned above, W/N, PRE, fuzzy searching and stemming are the ones the are useful dayly in addition to the standard boolean operators.

image

simkimsia commented 2 years ago

Hey there, paid donor here. I got a question.

How do i query something like this:

show me all the notes and blocks that contain this tag #revise in their content?

Expected output:

- note1#abc-def
- note1#ghi-jkl
- note2
- note3#abc-jo
...

Why note1 appears twice? because the tag #revise appears twice and each time they appear the nearest headings are abc-def and ghi-jkl respectively

note2 shows no heading as there is no heading in note2 contents

is this possible? I need this as an index list in dendron speak.

KucharczykL commented 2 years ago

Having something similar to https://github.com/blacksmithgu/obsidian-dataview would be amazing, not sure if it fits within this topic, though.

ScriptAutomate commented 2 years ago

Related:

YannisCS50 commented 1 year ago

Hi guys,

any follow-up regarding querying by frontmatter values? (or Dataview sort of...) Thanks