Searching for documents based on Markdown front-matter

I have started using Markdown front-matter for tags (instead of hash-tags), for example converting:



tags: someTag, someOtherTag

This works very well and, if Settings > Files > Import > Convert hashtags to tags is checked, then tags entered via Markdown front-matter are correctly “detected”.

As I’ve extended my use of Markdown front-matter, I’ve started adding other front-matter attributes. For example, I use an indexLevel attribute to “label” documents, e.g.:

tags: someTag, someOtherTag
indexLevel: 1

I’ve noticed, however, that Smart Groups and/or searches don’t “find”/search the front-matter text. That is, to continue the example, if I search for “indexLevel” I don’t find any documents—even though they have the text “indexLevel” in the Markdown front-matter.

Is there a way to have DEVONthink search on attributes / values declared in Markdown front-matter? If not, might it be possible to extend DEVONthink to enable such?

The raw Markdown source is not indexed by default.
Go into the built-in Help > Documentation > Appendix > Hidden Preferences and click the On link for IndexRawMarkdownSource.

Wow, that was fast! Thank you. DEVONthink and the DT dev team never cease to amaze me.

Two questions:

  1. The documentation contains the, rather ominous, text: “Note: These hidden preferences are not an official feature and could be changed or removed with any update.” Is IndexRawMarkdownSource and the associated functionality likely to be removed at some point, or can I safely depend on it sticking around?

  2. After enabling (i.e. quitting DT, running defaults write com.devon-technologies.think3 IndexRawMarkdownSource -bool TRUE from the command-line, and then re-launching DT) I see that existing notes aren’t “automatically” re-indexed. If I edit a note and save, though, then its Markdown contents is fully indexed. Is there a way to force a re-index of all existing notes?

You’re welcome and thanks for being amazed :smiley:

  1. Considering the functionality was just added, I’d say it’s safe to assume it won’t be removed soon.
  2. Make sure your local backups (i.e., not sync) are current and do a File > Rebuild Database.

Rebuild worked flawlessly, and Markdown front-matter attributes/values are now found via Smart Groups and search. Thank you.

You’re very welcome :slight_smile: