Include attachments in search pane

Use case or problem

Currently unable to find attachments in search pane. While it’s possible to find attachments using Quick Switcher and the [[…]] popup, it feels strange being unable to do so within the search pane.

Proposed solution

Include attachments in search results.

Current workaround (optional)

Make do with Quick Switcher / [[…]] popup, or use Finder / Explorer to search attachments folder.

7 Likes

This feature is pretty important when trying to determine which note links to “Pasted Image 202103021403.jpg” that is lying around in the file explorer. I name my attachments the same as the note they are in but sometimes I forget, or sometimes Obsidian is slow to rename and keeps both the original version and my newly named version. I need to be able to search for the attachment name to see where it shows up in the notes.

Please consider adding a switch in the search bar to include/exclude attachments. Heck, I’d love it if that switch were combined with another feature request that allowed us to view/hide attachments. Maybe it could be combined with both: when hidden, we can’t see the attachments and we can’t search for them; when enabled, the opposite happens.

I agree with the feature request. Just as a workaround suggestion in the meantime:

You can search for attachments. But if you are searching for all attachments, you’d have to search by filetype one at a time.
Example, to find all jpg files. This wouldn’t find .jpeg files though. :slightly_frowning_face: (Maybe someone has some fancy regex tricks for finding all images.):

file: /.*.jpg/

And you can find a specific file like this. This fuzzy matches too, as long as you type file: first.
file:name_of_file.gif

image

It isn’t all that powerful. For example, I don’t think you can search for attachments linked to a specific note, as far as I can tell.

Although if you link all your images with standard Markdown links, you could find the links to all png images inside content like this. Although again, only by one filetype at a time:

content: .png]]

file: Pasted is a search that will show all the images you copy/pasted, that got auto-named, “Pasted Image 3.png” etc.

This will be particularly useful for those of us who use Obsidian as a unified file and note directory. Being able to find both notes and say, PDFs, based on filename without having to remember to use the “file:” operator will be a huge quality of life improvement.

1 Like