What I’m trying to do
I’d like to exclude the contents under certain identical headings across different notes from vault search.
For example, let’s say I have three notes.
Note A:
## Fruits
Apples
## Vegetables
Carrots
Note B:
## Fruits
Oranges
## Vegetables
Carrots
Note C:
## Fruits
Bananas
## Vegetables
Carrots
I’d like the search queries Bananas
, Oranges
and Apples
not to bring up notes A, B and C because they are under an excluded heading ## Fruits
.
At the same time, I want the query Carrots
to bring up all three notes.
It appears that this is impossible with the built-in search functionality. Even if some regex pattern were to match ## Fruits
and everything below it until the next heading, that would just exclude the whole note from search, which is not what I want.
I’m asking in case there’s a community plugin that can help. I don’t want to turn to software outside Obsidian for this though.