Permanently exclude subfolders from search results

Discussion related to "Everything" 1.5 Alpha.
Post Reply
runmode
Posts: 21
Joined: Sat May 27, 2023 11:22 pm

Permanently exclude subfolders from search results

Post by runmode »

Hi,

I am looking for a comfortable way to change the serach path but keep subfolders excluded.

Use case: When I open a new Everything window starting from Windows Explorer using open-with or the Pause-Key
When moving files to various subfolders (cleaning up my photo collection by sorting pictures into subfolders with drag'n drop from Everything into subfolders in Windows Explorer), then I would like to see only the remaining pictures in Everything, not the pictures that I already moved)

I already tried the following:

/* ... adding an asterix
This would require me to edit the search term every time

parent:<path>
Same as above, need to edit search term
A filter 'parent:' does not work because a filter adds a space after the : (space for AND)

::parent:
I could not find out how this works (just an idea)

<path> !<path>\*\*
even more complicated


The solution could be a setting like Search - Match no subfolders.
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: Permanently exclude subfolders from search results

Post by NotNull »

Moved to Everything 1.5 forum
Please post your 1.5 related questions in that forum.


Not sure what you are after (where do you press th Space key or use the openwith option), but if the following gets the layout you want: there are options ...

Run the following command from the Command Prompt:

Code: Select all

"c:\Program Files\Everything 1.5a\Everything64.exe" -explore c:\Windows\System32 -explore-no-sub-folders -newwindow
This should open C:\windows\system32\ in Everything, showing it's files without showing subfolders.



@void:
-explore-no-sub-folders works
-no-explore-sub-folders does not; shows command-line options dialog
(in 1371a)
void
Developer
Posts: 16698
Joined: Fri Oct 16, 2009 11:31 pm

Re: Permanently exclude subfolders from search results

Post by void »

Would calling Everything with the -parent command line option be useful?

Add another context menu for folders under:

HKEY_CLASSES_ROOT\Folder\shell\Open parent in Everything

HKEY_CLASSES_ROOT\Folder\shell\Open parent in Everything\command
"C:\Program Files\Everything\Everything.exe" -parent "%1"


parent:<path>
Please try adding the following filter from Search -> Add to filters:

Name: Parent
Search: parent:search:
Macro: parentmacro<search>
Optionally bind a key to quickly toggle this filter.


::parent:
I will consider a global search modifier to disable searching subfolders.

Thank you for the suggestion.
void
Developer
Posts: 16698
Joined: Fri Oct 16, 2009 11:31 pm

Re: Permanently exclude subfolders from search results

Post by void »

-no-explore-sub-folders does not; shows command-line options dialog
Appears to work as expected for me.

Could you please check the "Command line:" value in the debug output (at the top):

Everything.exe -explore c:\Windows\System32 -no-explore-sub-folders -new-window -debug

Maybe there's another command line option causing the issue..
runmode
Posts: 21
Joined: Sat May 27, 2023 11:22 pm

Re: Permanently exclude subfolders from search results

Post by runmode »

Thank you for so many suggestions, I will try all, but start with this:
void wrote: Wed Mar 13, 2024 9:47 pm Please try adding the following filter from Search -> Add to filters:

Name: Parent
Search: parent:search:
I tried the filter before, just without the search: part.
Now, search: should be replaced by the search term, this was my intention.
This is the example you posted 2016 in viewtopic.php?t=5781

My problem is, when I apply this filter, my search result is empty. :(
Example:
search field: c:\Windows\System32 -> 23036 items
but with filter parent:search: -> 0 items :!:

Whereas search field w/o filter: parent:c:\Windows\System32 -> 5156 items

What's going wrong?
void
Developer
Posts: 16698
Joined: Fri Oct 16, 2009 11:31 pm

Re: Permanently exclude subfolders from search results

Post by void »

Setting the macro is important too.

Please make sure the macro is set and includes <search>



If you are using Everything 1.5 you can leave the macro blank and use the following search:

parent:$param:
runmode
Posts: 21
Joined: Sat May 27, 2023 11:22 pm

Re: Permanently exclude subfolders from search results

Post by runmode »

void wrote: Thu Mar 14, 2024 3:02 am Setting the macro is important too.
Thank you, this solved my problem. I thought, if I do not want to type a keyword, I could skip the macro definition, but this was wrong.

For others who read this, I summarize the filter definition that proved to work:

Example for a filter definition in v1.4 syntax:
Name: parent14
Search: parent:search:
Macro: parent14 <search>

Example for a filter definition in v1.5 syntax:
Name: parent15
Search: parent:$param:
Macro: parent15

The filter will be activated in the filter bar on demand and stays permanent when I change the search path.
In the search field I just have the path, such as c:\Windows\System32
The search result excludes what is inside subfolders.
This works nicely, great program.
Post Reply