Combining multiple substrings of paths with Boolean operators?

Discussion related to "Everything" 1.5 Alpha.
Post Reply
David.P
Posts: 200
Joined: Fri May 29, 2020 3:22 pm

Combining multiple substrings of paths with Boolean operators?

Post by David.P »

Hello forum,

I would like to use some sort of "lazy" path specification, in the sense that I'd combine two strings that I know occur somewhere in the same path, for example as follows:
Some-String-Inside-Some-Path\
AND
Some-Other-String-Inside-The-Same-Path\


For example, if I want to find all images that are at least in a certain depth of this path:
D:\OneDrive\Documents\Family\User Manuals, Instruction Manuals\Samsung Optical Smart Hub DVD Player SE-208DB\Scripts


... I'd like to use a search term for example like this:
User Manuals\ AND \Samsung pic:


Or is something like this already possible?
void
Developer
Posts: 16897
Joined: Fri Oct 16, 2009 11:31 pm

Re: Combining multiple substrings of paths with Boolean operators?

Post by void »

Searching can get awkward when the path contains a space.

I like to use \start-of-folder-name searches.
For example:

\OneDrive \Documents \Family \User \Samsung \Scripts pic:

Searching for the following might be enough:
\User \Samsung \Scripts pic:


With your example, you would need to escape the space:
"User Manuals\" \Samsung pic:

The following would also work:
Manuals\ \Samsung pic:


Another option is to enable Match Path from the search menu and search for:

user manuals samsung pic:


The following option might be of interest:
/path_search_type=3

With path search type 3, you can search for:
\User \Manuals \Samsung pic:
(You gain some speed typing but lose some accuracy as the \ no longer matches)


path_search_type
David.P
Posts: 200
Joined: Fri May 29, 2020 3:22 pm

Re: Combining multiple substrings of paths with Boolean operators?

Post by David.P »

Awesome, thank you!

I had the suspicion that this use case was of course already long considered :)
David.P
Posts: 200
Joined: Fri May 29, 2020 3:22 pm

Re: Combining multiple substrings of paths with Boolean operators?

Post by David.P »

One more question please regarding path search.
void wrote: Tue Jul 12, 2022 10:27 amAnother option is to enable Match Path from the search menu
[...]
The following option might be of interest:
/path_search_type=3
With path search type 3, you can search for:
\User \Manuals \Samsung pic:
I have now enabled both of the above options.

When searching for \haus, I seem to get all folders where the folder name, or any parent folder in the path, starts with haus, so far so good.

However, I also get some files in the search results that contain haus only inside the file name, but nowhere else in the path, for example a file like this:

C:\Users\David\OneDrive\Documents\Family\David\Macintosh\Data without backup from Macintosh\.finf\Letter to Peter FinkenHAUSer.doc

Is this intended behavior?
void
Developer
Posts: 16897
Joined: Fri Oct 16, 2009 11:31 pm

Re: Combining multiple substrings of paths with Boolean operators?

Post by void »

Yes, \haus matching haus in the name part is intended.

To limit your search to just the path part, please try the pathpart: search function.

For example:

pathpart:haus
David.P
Posts: 200
Joined: Fri May 29, 2020 3:22 pm

Re: Combining multiple substrings of paths with Boolean operators?

Post by David.P »

Ok thanks -- so with my current option settings, there is no difference when searching for \haus or for haus.

I wonder why this is so, and why \haus would not limit the search to a path element that starts with haus?

Particularly, why would it only match paths where a path element starts with haus, but also match filenames that contain haus?
void
Developer
Posts: 16897
Joined: Fri Oct 16, 2009 11:31 pm

Re: Combining multiple substrings of paths with Boolean operators?

Post by void »

/path_search_type=3 will ignore the \ and match haus anywhere in the filename.

Please try reverting back to /path_search_type=0 and see if the issue persists:
  • Copy and paste the following into the Everything search box:
    /path_search_type=0
  • Press ENTER in the Everything search box.
  • If successful, path_search_type=0 is shown in the status bar for a few seconds.
\haus will still match files that start with haus.
David.P
Posts: 200
Joined: Fri May 29, 2020 3:22 pm

Re: Combining multiple substrings of paths with Boolean operators?

Post by David.P »

Thank you, I am getting there slowly.
void wrote: Sat Jul 16, 2022 11:38 am\haus will still match files that start with haus.
Why is that so? Isn't the backslash a "search only for paths" operator?
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Combining multiple substrings of paths with Boolean operators?

Post by NotNull »

David.P wrote: Sat Jul 16, 2022 12:48 pm Why is that so? Isn't the backslash a "search only for paths" operator?
This is an age old discussion about what a filename and what a path is. No definitive answer thus far ..
This is how Everything handles it:

Example file: c:\some folder\my filename.txt

Typically, Everything searches only in the last (back)slash-separated component for matches.
In this case: "my filename.txt"

When Match Path is enabled and/or the search contains a (back)slash [1], Everything searches in the full filename (including the path).
In this case: "c:\some folder\my filename.txt"




[1] Not literally true, but I hope you get the point.
void
Developer
Posts: 16897
Joined: Fri Oct 16, 2009 11:31 pm

Re: Combining multiple substrings of paths with Boolean operators?

Post by void »

Why is that so? Isn't the backslash a "search only for paths" operator?
When using a \ in your search, Everything will search the full path (including the filename part).
Post Reply