What do you mean you can’t search within one file? You’ve got two searches available, one for the file Cmd/Ctrl Fand one across files from the left side pane.
They handle the search differently, but they’re there. If you don’t like the current file search, you can also use the global search with adding a path: to the local file, if I’m not mistaken.
For me, hitting Ctrl + F with the file open, and then typing # already will select the first tag. A second letter will continue to move the selection to the first matching tag.
Assuming that the tags are in the page with the list, a global search: tag:#tag path:"books/list of books" will show you all lines with that tag when you expand the result (a single note).
I’m sorry for misreading and taking this thread in a direction focusing on the search within a document, instead of catching the bit about the links having a certain quality, aka the linked note having that give tag.
Now, that I (hopefully) understand your requirements lets try two queries:
```dataview
TABLE WITHOUT ID out, out.tags, out.file.etags
WHERE file = this.file
FLATTEN file.outlinks as out
```
```dataview
LIST WITHOUT ID out
WHERE file = this.file
FLATTEN file.outlinks as out
WHERE contains(out.file.etags, "#non-fiction")
```
In my test setup I’ve created some books with various tags, and linked to all of those from my main document where I ran these queries. The output of the first query is as follows:
This displays all of then linked item from this file, aka file.outlinks, split into the separate links, out, and I display the link, the tags and the file.etags of this file. This query serves two purposes, it shows my test setup, and it also shows the base for further exploration related to filtering on the outlinks. If I’ve understood your use case correctly, you would like to only see the last two books which are tagged with #non-fiction. (How book can be both #fiction and #non-fiction is a debate for someone else… )
The second query outputs that list of the two (three including that strange book book ) books:
Hopefully the query is kind of self-explanatory, and addresses your issue correctly.
So the secret ingredient I could not think of is the “contains” function Very clever. I desperately tried to find a way to tell dataview “has the tag of #non-fiction” which proved not possible :))