Start a new topic

ability to search/filter items by contents of notes

Would you be willing to add an "item-notes" helper function to library.org, so that custom scheme filters can select items based on contents of the items' notes (a.k.a. underneath text)?  I tend to store large quantities of reference information in the form of text and plain lists beneath my orgmode headlines (a.k.a. items), so it would be useful to me to be able to match items (headlines) based on such content.


Similarly, it would also be handy to add to your list of single-letter search syntax tags an "n" tag.  So then if the search text is "n knuth n sorting" then an item would match if its notes (a.k.a. underneath) text contains both the word "knuth" and the word "sorting".


Since searching the entire text/notes of an item may be expensive, it seems sensible that the notes would only be searched if an "n" tag is present.  Also, one can probably keep searches quick by using the "n" tag in conjunction with other faster tags, for example "f personal n knuth n sorting" to search for a headline/item in "personal.org" whose notes/text contains the words "knuth" and "sorting".




1 person likes this idea

My intention is to cache the structure of the org files in a database to facilitate faster and more complex searching. Although that potentially may be premature optimisation just to provide access to searching of the contents of a note. The Scheme query may be more complex to implement as it would either involve passing over the notes content for each item to be queried (simple) or to determine if the query is going to look at the notes in order to only pass over the notes where necessary (more complicated). I'll need to experiment to see whether it is going to work acceptably well.


1 person likes this

For the  people using org-mode for note-taking+TODO tracking, this feature is handy!


1 person likes this

I suppose you may decide on some lazy-evaluation mechanism whereby the notes content of a given headline is not fetched until the first time it is needed.  So then for typical use it won't matter much if searching the notes is an expensive operation.  And a user may decide to build a less expensive search query by prepending search tags that do not depend on the notes content.



Login or Signup to post a comment