Help with embedded search query syntax

What I’m trying to do

One thing I use Obsidian for is to track outstanding questions and topics related to specific colleagues and projects. I use links for each teammate (e.g. [[Billy Bob]]) and tags for questions and projects (eg. #questions and #ABCproject).

I want a place where I can surface questions or notes from previous meetings with specific people. I would like to do this on the note page for that person. For example, if I open the [[Billy Bob]]) page I can see all questions I have for him. I’m open to other ways of doing this. But this is my ideal set up, and if possible I would like to avoid using data views.

Things I have tried

I have tried using an embedded query, but I can’t seem to get it to respect multiple conditions and return only #questions from [[Billy Bob]].

I have tried the following:

tag:#questions [[Billy Bob]]
tag:#questions AND [[Billy Bob]]

The search query should be:

tag:#questions "[[Billy Bob]]"

This indicates: find the tag AND (implicit) the literal string.

Without the quotes, […] denote syntax for finding properties (i.e., within the YAML properties section, thus has a different meaning. You can find all the secrets of Obsidian queries in the help.

By the way, your method for approaching this is excellent.

1 Like

This one seems to find tag:#questions or [[Billy Bob]].

image

I cannot reproduce that. An “AND” is implied between search terms. In my test, a page featuring the tag but not the name is not found.

Got it. Guess just copy paste the text below in one note you can reproduce as the #4 image shows.

#questions [[Billy Bob]]
#questions [[others]]

The query you showed in #2 matches notes only if both terms occur in the same sentence and is obviously preferred provided OP tags within a single sentence. The more minimal query finds notes where both of the terms occur anywhere. In the context, all occurrences are mentioned.

Thanks! This works. I realise now what the problem was. I had a daily notes page with notes from multiple meetings. When I tried to use the query it returned that daily notes page, and highlighted all instances of people (e.g. “[[Billy Bob]]”) and the #questions tag, along with the line I was actually trying to surface that had both [[Billy Bob]] and the #questions tag. So this was a just confusing caused by the display of the results, not the accuracy of the results. It would be nice to query and only get the specific line(s) that have the link and the tag, though. This way I could keep using daily notes pages for meetings and not surface loads of irrelevant results when querying for topics/questions related to one person. Is there a way to do this?

If you want to find #questions and [[Billy Bob]] on the same line, you can try
line:(#questions "[[Billy Bob]]") . More ref: Obsidian Help - Search operators.

image

image

1 Like

Thank you!