Find content using dataview

First, search the help docs and this forum. Maybe your question has been answered! The debugging steps can help, too. Still stuck? Delete this line and proceed.

What I’m trying to do

find a md file with content xxx in the file

Things I have tried

I type this in the source view

LIST FROM "" 
WHERE contains(file.content, "xxx")

xxx is the content. I am searching the entire vault. XXX exists in an md file.

I have been looking on the web and in the community. My code seems right. I think I should find a list of files in the reading view. What do I have wrong?

I also tried this, but it does not work.

LIST
FROM ""
WHERE contains(file.content, "#yyy") OR contains(file.content, "#xxx")

What kind of a tag do you want to find? Just a random text? Or an actual tag like #thisTag.

Dataview don’t know anything called file.content by default. You could define a property (or field) with that name, but it wouldn’t contain the entire content of the file in either case.

If you want a general text search in all files you could look into doing embedded search queries, which would allow searches like those in the search panel.

I got my solution from AI. Not trustworthy.

I should be able to pull up the tags.
LIST
FROM “”
WHERE this.file.#xxx

xxx is a specific tag in my vault.

If you’re just looking for a list of notes with the tag #xxx, the query would be:

```dataview
LIST
FROM #xxx
```

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