Exclude folders that contain a specific file from results?

Discussion related to "Everything" 1.5 Alpha.
Post Reply
wkearney99
Posts: 17
Joined: Sun Nov 07, 2021 2:42 pm

Exclude folders that contain a specific file from results?

Post by wkearney99 »

Is there a way to only show result files from folders that do NOT contain a specific file already?

I have a bunch of folders that contain images. Some already contain an index.jpg file. I want to exclude the ones that already have that index.jpg file, while still showing all the image files from other folders.

I've looked at the !child-file:index.jpg function but that only returns me the folders that don't contain the index.jpg file.

I could, of course, exclude the index.jpg image file itself, but that wouldn't exclude the files from the folders that have it already. I don't need to see ANY of the image files from folders that already have an index.jpg.

My end-goal here is to use the advanced rename function on manually selected files. But if the folder already contains the name then I get the rename error dialog.

Is there a way to do this?

My alternative would be to use the !child-file: function and move the folders to somewhere else temporarily, and then do the selecting/renaming.
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Exclude folders that contain a specific file from results?

Post by NotNull »

If I understood correctly (?), this should give you the desired results:

Code: Select all

pic:   !exact:sibling:index.jpg   !exact:index.jpg

If this is not what you wanted, please provide some (more or less) real-world examples.
DerekZiemba
Posts: 44
Joined: Thu Sep 27, 2018 4:46 pm

Re: Exclude folders that contain a specific file from results?

Post by DerekZiemba »

I brought up something similar here: viewtopic.php?p=60046#post_content60047
NotNull said he would consider something like it viewtopic.php?p=60083#post_content60083
The difference between my suggestion & what you're asking: I was looking for something more like !ancestor: (I believe !parent:'s already an existing function) that can be used to build queries. For example:
  • !ancestor:attributes:HDI to filter all children with an ancestor that's a (H)idden, (D)irectory, Not(I)ndexed. One could easily exclude entire directory trees by right clicking a folder, selecting properties & in the General tab, checking "Hidden" & unchecking "Allow files in this folder to have contents indexed in addition to file properties"
  • !ancestor:owner:<"SYSTEM"|"TrustedInstaller"|"SERVICE"> would filter out a whole lot of noise for my typical searches. This is just an example of course. My real goal is to be able to combine this with more terms, like:
    !ancestor:< attributes:HD owner:"SYSTEM"|"TrustedInstaller"|"SERVICE" >
  • If an ancestor function existed, I imagine something like this would work for your scenario:
    !ancestor:child-file:index.jpg
I could definitely also go for something more basic like you're suggesting too. Would more or less solve the same problem. I'd drop some empty & hidden `.everything-search-ignore` files into any directory I don't want to normally see then add something like one of the following to my Home filter.
!< child-file:".everything-search-ignore" >
!< child-file:extension:"everything-search-ignore" >

I took inspiration for ancestor from xpath. I'd love to be able to do full xpath queries on the filesystem & all it's attributes (in bookmarks, filters, & macros) like:
//*[self::folder or self::file][not(ancestor::folder[@attributes=HCI]/descendant::file/sibling::file[@extension='jpg'][@perceivedType='image'][contains(@name, 'index')])]
Imagine the power
wkearney99
Posts: 17
Joined: Sun Nov 07, 2021 2:42 pm

Re: Exclude folders that contain a specific file from results?

Post by wkearney99 »

Yes! Using it along with depth: helped narrow down to just the directories I needed (and none of the subdirectories). Thanks!

That and using !string to exclude others also helped.
vdw1463
Posts: 3
Joined: Fri Oct 13, 2023 8:02 pm

Re: Exclude folders that contain a specific file from results?

Post by vdw1463 »

NotNull wrote: Thu Oct 26, 2023 7:49 pm If I understood correctly (?), this should give you the desired results:

Code: Select all

pic:   !exact:sibling:index.jpg   !exact:index.jpg

If this is not what you wanted, please provide some (more or less) real-world examples.
Just wondering, is it expected behavior that ticking "Search > Match Path" gives no results when doing exact:<filename>?
void
Developer
Posts: 16776
Joined: Fri Oct 16, 2009 11:31 pm

Re: Exclude folders that contain a specific file from results?

Post by void »

Yes, enabling match path from the Search menu will force Everything to match the path and the name.

With match path enabled, you would need to search for:

!exact:"C:\folder A\folder B\index.jpg"

(where C:\folder A\folder B is the location of your index.jpg)



If you want to keep match path enabled under the Search menu, please try the following search:

pic: !exact:sibling:index.jpg !exact:name:index.jpg

The name: search function will match only the name part (ignoring your Match Path setting)



name:
Match Path
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Exclude folders that contain a specific file from results?

Post by NotNull »

void, you are way too fast!
(deletes message ...)

Oh wait:
nopath:exact: could help here too
vdw1463
Posts: 3
Joined: Fri Oct 13, 2023 8:02 pm

Re: Exclude folders that contain a specific file from results?

Post by vdw1463 »

void wrote: Tue Nov 07, 2023 9:21 pm Yes, enabling match path from the Search menu will force Everything to match the path and the name.
Thank you for the clarification. I was initially confused because this page under "Match Path" said match path/filename OR just filename. So I assumed exact: would account for both.

Also did not know about nopath, so thanks to both of you!
Post Reply