Graph-view: Is there a way to exclude embedded images within notes from the Graph-view

Things I have tried

Have searched the Obsidian forum under Graph-view but have been unable to find a solution to my problem above.

What I’m trying to do

My embedded images are located in the vault in the attachments sub-folder. I also have my notes in yet another sub-folder. When filtering the graph-view I restrict it to my notes sub-folder and do NOT have attachments toggled on and yet all the embedded images within the notes are displayed in addition to the notes themselves. Is there a way that I can exclude the images please?

1 Like

Would a query work?

grafik

-path:"subfolder where images are located"

1 Like

Thanks but no joy. I tried path:"125 Sources" and -path:"999 Attachments", but the Graph-view still includes my images from the “999 Attachments” folder.

1 Like

Can you post a screenshot?

1 Like

Sure … Here you go…

1 Like

https://help.obsidian.md/Plugins/Search
Please take a look at this. You’re using and which should just be a space. Sorry that I didn’t realise that earlier.
Then it should work.

1 Like

I’m just going to swing the bat and hope I hit something, @Carriolan and @koala. But I don’t think this is correct. The operators AND and SPACE are the same. From the help page:

Boolean operations can be used. Use OR to match one or another. Use - to negate a query. The space character is used for boolean “and”.

I’m thinking the PATH solution was correct, but the syntax wrong. Instead of:

path:"125 Sources" and -path:"999 Attachments"

It should be:

path:"125 Sources" and path:-"999 Attachments"

Even a broken clock is right twice a day, so I have hope! Or maybe it’s just path:-"999 Attachments" alone.

I’m basing that off the syntax @Licat used here: https://forum.obsidian.md/t/obsidian-release-v0-9-0/5975

Regrettably SPACE seems to be an alternative to AND and therefore the PNG’s and JPG’s are still appearing.

Hi, I have used the syntax as you suggested but the PNGs, JPGs are still displayed.

Well, @Carriolan. I did some more digging. I’m not sure why turning your attachment folder off doesn’t work. So, I turned mine on and fiddled with those queries. I found that for me, the following query excludes JPG’s and PNG’s:

file:-".jpg" and -".png"

Hopefully, it’ll work for you. Otherwise, we’ll keep thinking.

Also, if that doesn’t work (and this is kind of obvious, just checking the boxes off) but you did actually SET the attachment folder by right clicking it and clicking Set as Attachment Folder, then confirming it in settings, under files and links, that the folder path is correctly set, right?

Eureka! Thanks @Scribe I did as you suggested and used the file syntax which worked. Thanks also to @koala.

Fantastic!

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