Query, Search operators for Properties (YAML metadata)

Use case or problem

Add a native search option similar to “line” and “section” but for “YAML” to just search YAML frontmatter. So like yaml:(person) for example.

Proposed solution

Add a native search option similar to “line” and “section” but for “YAML” to just search YAML frontmatter. So like yaml:(person) for example.

Current workaround (optional)

Right now I just search the entire file contents for my YAML which works but also gets false positives from other stuff in the file / page.

25 Likes

relates to Allow links in YAML front matter; Notion-like databases from metadata; links as first-class citizens

1 Like

specifically, this might be a cleaner alternative

1 Like

I think though these are two different use cases / FR aren’t they? I want both. Links in frontmatter to “work” and also a search operator to just do native search stuff in front matter. Right?

1 Like

I would second this. The ability to limit search to YAML would be useful.

1 Like

I third this. I was surprised to not find a single mention of how to search YAML on YAML front matter or Search

2 Likes

Use case or problem

YAML metadata headers are a useful way to add information to a page. It would be nice to have a clean and efficient way to search them
using Obsidian’s core search features.

Proposed solution

A search operator like key:: (notice the double colon), where “key” is any arbitrary metadata header in your notes’ YAML metadata.

Current workaround (optional)

Dataview.

https://blacksmithgu.github.io/obsidian-dataview/

However, Dataview queries are a bit harder to write than Obsidian’s core search queries, and there’s no “search pane” for dataview.

27 Likes

:sob:
thought the operator was already added as a new feature and tried for 30 minutes…

1 Like

+1 for this suggestion.

It would be especially useful if this new search operator also applied to the Graph view’s Filters → “Search files…” and Groups → “Enter query…” and showed as one of the search options in the context menu


Related/possible duplicate: Search operator for YAML similar to Line / Section

5 Likes

1+ for this.
Dataview is good, but I’d like to be able to highlight groups in the graph using YAML keys.
That would be FAB, because I use YAML extensively to categorize my content

+1. With the upcoming improvements to properties, this feature would make a lot of sense. I would love to be able to use properties in query blocks and graph view.

+1 Upcoming obsidian properties is great. But the real potential of properties, especially because they are typed (date, time, tags, list etc) will only be realized, once it is possible to search/filter upon them with specific query type for each type like: property(published) < 2010 for values of property published with date type before the year 2010, and so on…

7 Likes

will be implemented 1.4.4.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.