Search Folders then See the SubItems from all results of folders

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
mariedriscoll01
Posts: 2
Joined: Fri Aug 20, 2021 8:13 am

Search Folders then See the SubItems from all results of folders

Post by mariedriscoll01 »

Hi! Would like to ask a question if its possible to search the folders and see the subitems for all the folders that appears like the one that I have attached. Looking to See All the Subitems and also Search specifically just the image for subitems.Thank you!
Image
void
Developer
Posts: 16678
Joined: Fri Oct 16, 2009 11:31 pm

Re: Search Folders then See the SubItems from all results of folders

Post by void »

Sorry, I don't have an easy way to do this in Everything 1.4, please try the following search:

path:halloween
(matches files and folders with halloween anywhere in the path)

-or-

*halloween*\*
(If you don't want to match halloween in the file filename)



For Everything 1.5, you can drag-drop the folders onto the search box, or copy them to the clipboard and paste them in the search box.
Mizufluffy
Posts: 62
Joined: Sun Jun 13, 2021 10:22 am

Re: Search Folders then See the SubItems from all results of folders

Post by Mizufluffy »

I don't know how this could be done in 1.4 but I have an alternative solution for 1.5a (tested in 1.5.0.1272a). This search lists files if the direct parent folder includes the searched word.

For example, it can find files in

Code: Select all

C:\temp\theHalloweenHere
C:\temp\theHalloweenHere\halloween
C:\temp\theHalloweenHere\some halloween files here (but not really)
but not in

Code: Select all

C:\temp\theHalloweenHere\someFolder
because even though halloween is in the path but the parent folder, someFolder, does not contain halloween.

The basic layout of the search is:

Code: Select all

files: regex:pathpart:".*\\[^\\]*halloween[^\\]*$"
where halloween is the word you want to search for. You can further customize it by using filters or edit the search.

If you want to make it into a bookmark with a macro then you can set search as

Code: Select all

files: regex:pathpart:".*\\[^\\]*this:[^\\]*$"
and macro as

Code: Select all

locate<this>
and use it like this:

Code: Select all

locate:halloween
in the Everything search field.

Here's an example of how I used it. For testing purpose I limited it under C:\temp directory but I had various folders and files below it to make sure it would work. On the left side you can see all files and folders under C:\temp and on the right side you can see the result when search is applied. (open image in new tab if it's too small)
2021-08-22 07_01_18-Everything-Search-Comparison.png
2021-08-22 07_01_18-Everything-Search-Comparison.png (190.42 KiB) Viewed 5302 times


And here is the bookmark settings and bookmark macro in use:
2021-08-22 07_03_07-Everything-Bookmark.jpg
2021-08-22 07_03_07-Everything-Bookmark.jpg (224.36 KiB) Viewed 5302 times
mariedriscoll01
Posts: 2
Joined: Fri Aug 20, 2021 8:13 am

Re: Search Folders then See the SubItems from all results of folders

Post by mariedriscoll01 »

Absolutely Great! I appreciate your help and this is what I'm looking for. Thank you void and Mizufluffy!
Mizufluffy
Posts: 62
Joined: Sun Jun 13, 2021 10:22 am

Re: Search Folders then See the SubItems from all results of folders

Post by Mizufluffy »

I actually yesterday had to fix one of my bookmarks to something similar like this and realized it didn't quite work as expected in my case. This is because

Code: Select all

files: regex:pathpart:".*\\[^\\]*this:[^\\]*$"
finds paths where search term is a substring of another word. For example, fact is a substring of satisfaction so if you were looking for path "..\One Fact and Truth\" you could also find "..\Little Satisfaction\" by accident. Usually when people search something with words, we start typing at the beginning of a word. Luckily there is an easy solution for this:

Code: Select all

files: regex:pathpart:".*\\[^\\]*\bthis:[^\\]*$"
The \b marks a word boundary, in other words it means the search term starts from the beginning a word so satisfaction won't come up when searching for fact.

So, using the halloween example from earlier this new search would find files in these directories

Code: Select all

C:\temp\Every Halloween is Exciting
C:\temp\theHalloweenHere\halloween
C:\temp\theHalloweenHere\some halloween files here (but not really)
but not in these

Code: Select all

C:\temp\Every Halloween is Exciting\someoldhalloweenfiles
C:\temp\theHalloweenHere
C:\temp\theHalloweenHere\NewHalloween
This alone can help with filtering some potentially unwanted results but...

Extra:
It is also possible to add \b on the other side too if you want to match full words only:

Code: Select all

files: regex:pathpart:".*\\[^\\]*\bthis:\b[^\\]*$"
However, this can lead to various problems such as locate:book can't find folders with word books in them. It is also possible to add \b (or \B which has opposite meaning of \b) directly to the search field:
locate:book\b or locate:book\B
instead to use it only when needed.

The former would find files in folders with a word "book" as part of the folder name and latter files in folders with a word that starts with "book" as part of the folder name but not word "book" ("books" would be acceptable).

One use case for this would be if you want to find very short words (e.g. in, on, is, no) that could easily be a substring of a longer word and filtering out those longer words out completely. For example, "\bin" could find "Table in House" or "Incomplete House" but "\bin\b" would find only "Table in House" and "\bin\B" would find "Incomplete House" but not "Table in House". So, with the search introduced earlier in this post,

Code: Select all

files: regex:pathpart:".*\\[^\\]*\bthis:[^\\]*$"
and with locate<this> macro, you could use

Code: Select all

locate:in\b
or

Code: Select all

locate:in\B
in the Everything search field to find "Table in House" or "Incomplete House" respectively.
Post Reply