Dataview works with metadata, not the full content. You can use inline fields, tasks or bullet lists to play with some specific “content”. For example:
## inline fields
summary:: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur eu magna id est interdum euismod id at lectus. Aliquam aliquam, lectus at cursus volutpat, mi libero malesuada enim, in iaculis augue elit ut tellus. Aenean dignissim lorem non urna tempus sollicitudin.
## bullet list
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur eu magna id est interdum euismod id at lectus. [field:: todo]
- Aliquam aliquam, lectus at cursus volutpat, mi libero malesuada enim, in iaculis augue elit ut tellus. Aenean dignissim lorem non urna tempus sollicitudin.
## tasks
- [ ] this is a task with a #todo
About the query way, I think that’s no possible. But also, what kind of context you image to see if the wanted tag is placed in frontmatter and no in the content? Preview what? Some lines before and after?
As of 0.12.12, there are four keys natively supported:
which means that these metadata in the YAML front matter are not dataview’s feature, they are Obsidian’s feature. I think Obsidian ought to be able to organize for these tags.
Do you think it is a bug? If you think so too, I could report a bug.
P.s. Of course, it can be workaround by add a normal tag (e.g. #todo) in the head of my markdown file. (But that means there are duplicate tags.)