~protesilaos/denote

4 3

search "framework"

Saša Janiška <sjaniska@atmarama.net>
Details
Message ID
<878r3ryto4.fsf@ddns.net>
DKIM signature
missing
Download raw message
Hello!

I'm about to start more intense study of some subject and 
anticipate
create larger number of notes which means that it is the time to
(finally) settle on note-taking application. :-)

Besides Denote another candidate is Ekg with different 
philosophy...

We like Denote's simplicity and future-proofability, iow. ability 
to
change to something else without any worry. Being aware of 
Denote's
file-naming scheme and all advantages it does provide, I'm 
interested if
some tips how to provide a "framework" to assist in general search
feature. Namely, besides in looking for specific notes based on 
its
signature and the context it provides, we would like to be able to
filter our notes on keywords (aka tags) as well as the note's 
content,
resembling full-text search (fts) which is provided by 
e.g. sqlite3
database (in Ekg).

Do you have any advice how to do it in Denote?


Sincerely,
Saša


-- 
One is understood to be in full knowledge whose every endeavor
is devoid of desire for sense gratification. He is said by sages
to be a worker for whom the reactions of work have been burned
up by the fire of perfect knowledge.
Details
Message ID
<87frxxq77n.fsf@protesilaos.com>
In-Reply-To
<878r3ryto4.fsf@ddns.net> (view parent)
DKIM signature
pass
Download raw message
> From: Saša Janiška <sjaniska@atmarama.net>
> Date: Sun, 11 Feb 2024 15:05:00 +0100
>
> Hello!

Hello Saša,

> I'm about to start more intense study of some subject and anticipate
> create larger number of notes which means that it is the time to
> (finally) settle on note-taking application. :-)
>
> Besides Denote another candidate is Ekg with different 
> philosophy...
>
> We like Denote's simplicity and future-proofability, iow. ability to
> change to something else without any worry. Being aware of Denote's
> file-naming scheme and all advantages it does provide, I'm interested
> if some tips how to provide a "framework" to assist in general search
> feature. Namely, besides in looking for specific notes based on its
> signature and the context it provides, we would like to be able to
> filter our notes on keywords (aka tags) as well as the note's content,
> resembling full-text search (fts) which is provided by e.g. sqlite3
> database (in Ekg).
>
> Do you have any advice how to do it in Denote?

Two common ways to approach this:

- Do a multi-level search. You start with, for example, a
  'denote-sort-dired' command to produce a filtered and sorted Dired
  buffer. Then you use one of the grep tools in Emacs (e.g. M-x lgrep,
  M-x rgrep, ...) or the equivalent provided by a package (e.g. M-x
  consult-grep from the consult package). With these grep tools you
  match file contents.

- You use the 'recoll' program, probably in tandem with the
  consult-recoll interface, to index your documents for search purposes.
  Recoll lets you perform more advanced searches.

Taking a step back, you will benefit from being careful with the initial
production of a note. Write keywords that are sufficiently descriptive,
but not too specific because then you will have unique keywords all over
the place. Also, get in the habit of writing metanotes, else a note that
provides an overview about notes on a given topic. If you put enough
effort into your metanotes, they will serve as the points of entry to
your knowledge base. Then the searching part changes, as you are likely
starting from this focused view.

All the best,
Prot

P.S. I am phasing out SourceHut: <https://protesilaos.com/codelog/2024-01-27-sourcehut-no-more/>.
Development continues on GitHub with GitLab as a mirror.

-- 
Protesilaos Stavrou
https://protesilaos.com
Details
Message ID
<87a5o4x2a3.fsf@prevos.net>
In-Reply-To
<878r3ryto4.fsf@ddns.net> (view parent)
DKIM signature
pass
Download raw message
Hi Saša,


> ... I'm interested if
> some tips how to provide a "framework" to assist in general 
> search
> feature. Namely, besides in looking for specific notes based on 
> its
> signature and the context it provides, we would like to be able 
> to
> filter our notes on keywords (aka tags) as well as the note's 
> content,
> resembling full-text search (fts) which is provided by 
> e.g. sqlite3
> database (in Ekg).

Have a look at consult-notes: 
https://github.com/mclear-tools/consult-notes.
This package provides an interface to search Denote files, 
including the
content. This package can service multiple silos of Denote files.

Example configuration:

  (use-package consult-notes
    :bind
    (("C-c d f" . consult-notes)
     ("C-c d s" . consult-notes-search-in-all-notes))
    :custom
    (consult-notes-file-dir-sources
     `(("Notes"  ?n ,denote-directory)
       ("Silo 1" ?a "file-path1"))
       ("Silo 2" ?b "file-path2"))))

You can narrow to a silo with <a or <b.

Searching for signatures, tags etc is done through regular 
expressions.

Searching in all notes requires grep or ripgrep.

Regards


P:)


-- 
Dr Peter Prevos
---------------
peterprevos.com
Saša Janiška <sjaniska@atmarama.net>
Details
Message ID
<875xyqcd71.fsf@ddns.net>
In-Reply-To
<87frxxq77n.fsf@protesilaos.com> (view parent)
DKIM signature
missing
Download raw message
Protesilaos Stavrou <info@protesilaos.com> writes:

> - Do a multi-level search. You start with, for example, a
>   'denote-sort-dired' command to produce a filtered and sorted 
>   Dired
>   buffer. Then you use one of the grep tools in Emacs (e.g. M-x 
>   lgrep,
>   M-x rgrep, ...) or the equivalent provided by a package 
>   (e.g. M-x
>   consult-grep from the consult package). With these grep tools 
>   you
>   match file contents.

Good.

> - You use the 'recoll' program, probably in tandem with the
>   consult-recoll interface, to index your documents for search 
>   purposes.
>   Recoll lets you perform more advanced searches.

Thank you for that. I was not aware of this package!

> Taking a step back, you will benefit from being careful with the 
> initial
> production of a note. Write keywords that are sufficiently 
> descriptive,
> but not too specific because then you will have unique keywords 
> all over
> the place.

I believe that would not be a problem.

> Also, get in the habit of writing metanotes, else a note that
> provides an overview about notes on a given topic. If you put 
> enough
> effort into your metanotes, they will serve as the points of 
> entry to
> your knowledge base. Then the searching part changes, as you are 
> likely
> starting from this focused view.

I've to think more about it, iow. whether writing metanotes would 
not be
too time consuming for my knowledge base...


Sincerely,
Saša

-- 
But for one who takes pleasure in the self, whose human life
is one of self-realization, and who is satisfied in the self only,
fully satiated — for him there is no duty.
Saša Janiška <sjaniska@atmarama.net>
Details
Message ID
<871q9ecd17.fsf@ddns.net>
In-Reply-To
<87a5o4x2a3.fsf@prevos.net> (view parent)
DKIM signature
missing
Download raw message
Peter Prevos <peter@prevos.net> writes:

> Have a look at consult-notes:
> https://github.com/mclear-tools/consult-notes.
> This package provides an interface to search Denote files, 
> including
> the
> content. This package can service multiple silos of Denote 
> files.
>
> Example configuration:
>
>  (use-package consult-notes
>    :bind
>    (("C-c d f" . consult-notes)
>     ("C-c d s" . consult-notes-search-in-all-notes))
>    :custom
>    (consult-notes-file-dir-sources
>     `(("Notes"  ?n ,denote-directory)
>       ("Silo 1" ?a "file-path1"))
>       ("Silo 2" ?b "file-path2"))))

Thank you for the snippet!

> You can narrow to a silo with <a or <b.

That's cool.

> Searching for signatures, tags etc is done through regular
> expressions.

Ahh, have to brush up my regex skills. :-)

> Searching in all notes requires grep or ripgrep.

Thanks!


Sincerely,
Saša

-- 
Thus the wise living entity's pure consciousness becomes covered 
by
his eternal enemy in the form of lust, which is never satisfied 
and
which burns like fire.
Reply to thread Export thread (mbox)