Ignore punctuation + Match path - Everything ignores backslash for matching

Discussion related to "Everything" 1.5 Alpha.
Post Reply
aviasd
Posts: 120
Joined: Sat Oct 07, 2017 2:18 am

Ignore punctuation + Match path - Everything ignores backslash for matching

Post by aviasd » Wed May 05, 2021 7:14 am

Hi,
When match path and ignore punctuation is enabled, everything will ignore backslash and continue matching after \
for example:
When querying for: movies

Code: Select all

c:\movie\subtitles\somefile.srt
Is also matched.
I may continue typing moviesubtitle and the match is persistent.
Is this by design?
If so, I think it should be noted Here
Edit: It is noted now in the help link above. Was it always there? :roll:

void
Site Admin
Posts: 6880
Joined: Fri Oct 16, 2009 11:31 pm

Re: Ignore punctuation + Match path - Everything ignores backslash for matching

Post by void » Thu May 06, 2021 5:24 am

Everything ignore all unicode characters with the punctuation class.

This includes \ and / for full paths.

Updated: Ignore punctuation.

Note: The nopunc: search modifier can be used with other search functions, such as title:, subject:, artist:, album:, content: etc...
nopunc: is not specific to filenames.
Edit: It is noted now in the help link above. Was it always there?
I added the hint as soon as I saw your post.
I looked into possible solutions, such as treating \ and / differently (not as punctuation).
However, I feel the rules for ignore punctuation should be simple:
Unicode characters with the punctuation class are treated as punctuation.

This can be a curse or a blessing:
nopunc:c:windowssystem32driversetchosts matches C:\Windows\System32\Drivers\ETC\hosts

Another note: punctuation you specify in your search will match punctuation in the filename. (in other words, punctuation in your search is not ignored)
eg: The search for movie\s will only match movie\s (and not movies)

Maybe I can help with improving path matching for you with Match Path disabled under the Search menu..
Is there a reason for using Match Path under the Search menu? Can you give an example of how you use this setting?

aviasd
Posts: 120
Joined: Sat Oct 07, 2017 2:18 am

Re: Ignore punctuation + Match path - Everything ignores backslash for matching

Post by aviasd » Thu May 06, 2021 7:03 am

void wrote:
Thu May 06, 2021 5:24 am

Edit: It is noted now in the help link above. Was it always there?
I added the hint as soon as I saw your post.
Ah thanks, thought I was getting senile there..
This can be a curse or a blessing:
nopunc:c:windowssystem32driversetchosts matches C:\Windows\System32\Drivers\ETC\hosts
Yeah, that's what I thought, it's a nice feature but was a bit surprising.
Another note: punctuation you specify in your search will match punctuation in the filename. (in other words, punctuation in your search is not ignored)
eg: The search for movie\s will only match movie\s (and not movies)
That's good to know.. (It's on by default here)
Maybe I can help with improving path matching for you with Match Path disabled under the Search menu..
Is there a reason for using Match Path under the Search menu? Can you give an example of how you use this setting?
Well, match path option is enabled on all my machines by default since I first discovered everything ( I think since everything 1.2 )
It's so integral in my flow that I had to stop and think about how I use it
Match path allows me to be quick and messy without planning ahead

For example:
Say I want to find C:\Windows\System32\Drivers\ETC\hosts

I start by typing hosts - 119 results
I know it's somewhere in windows\system32 so i type system and there it is. Don't need to type anything else, don't need to prefix system with "\". easy.

Another example:
I want to watch a nice series, let's say Futurama but I don't know which episode I'm on.
I start typing futurama and get heaps of non-relevant files.
I know it's under the series folder so I type series\.
Now it's better and looking at the results, I remember that I was on season 2.
I see in the results that the folder name is something like "futurama season s02 ...." so i just type s02 ( Part of the folder name) and now I see what I want.

I know it may sound like a roundabout method for some people but it happens so quickly for me that I don't even have to think about it.
With match path disabled, I could not get partial folder names so easily and would have to invest some time thinking on how to "articulate" what I want...

Hope that explains it..

therube
Posts: 2942
Joined: Thu Sep 03, 2009 6:48 pm

Re: Ignore punctuation + Match path - Everything ignores backslash for matching

Post by therube » Thu May 06, 2021 2:45 pm

Match Path under the Search menu? Can you give an example of how you use this setting?
.
.

Code: Select all

/Jethro Tull/Thick as a brick-01.mp3
/Jethro Tull/Thick as a brick-02.mp3
/Jethro Tull/Thick as a brick-03.mp3

/Jethro Tull - Thick as a brick/01.mp3
/Jethro Tull - Thick as a brick/02.mp3
/Jethro Tull - Thick as a brick/03.mp3
audio: thick as a brick

Without Match Path, 01, 02, 03.mp3 wouldn't be found.

audio: jethro tull

Without Match Patch, nothing would be found.

void
Site Admin
Posts: 6880
Joined: Fri Oct 16, 2009 11:31 pm

Re: Ignore punctuation + Match path - Everything ignores backslash for matching

Post by void » Mon May 10, 2021 9:28 am

Thank you for the usage examples.

I'll look into ways to improve path searching.

aviasd
Posts: 120
Joined: Sat Oct 07, 2017 2:18 am

Re: Ignore punctuation + Match path - Everything ignores backslash for matching

Post by aviasd » Mon May 10, 2021 10:42 am

void wrote:
Mon May 10, 2021 9:28 am
Thank you for the usage examples.

I'll look into ways to improve path searching.
It may be difficult because right now with match path enabled, typing what folder you want is the most straightforward way - you don't need to add any special characters or specify anything special to match the path.

What can be the alternatives?
For now , to replicate match path I need something like:
hosts path:<c: windows etc>

I've tried:
Hosts path:windows**etc
doesn't seem wildcard matching is working there.

There's also
hosts ::path: windows etc

But that's a tad annoying to type.

I think from all of the above probably this would be the most intuitive to switch to:
Hosts path:windows**etc

And maybe shortening with a p: macro, But still much more typing than the original...

I don't have a solution here, just throwing in my opinion to the mix.

void
Site Admin
Posts: 6880
Joined: Fri Oct 16, 2009 11:31 pm

Re: Ignore punctuation + Match path - Everything ignores backslash for matching

Post by void » Mon May 10, 2021 10:54 am

Thanks for the feedback aviasd,

There's \: in the latest Everything alpha

(It is undocumented as it is experimental)

For example:

hosts \:windows \:etc

The extra typing of two characters is still a pain..

I'm considering an option to allow a single slash to enable match path, eg:
hosts win\ et\
-or-
hosts \ndows \tc
-This will break some useful searches when you want to match the start of filenames.


There's also:
*\hosts
this will find files exactly-named hosts. Unfortunately, it finds files anywhere..

path:windows**etc
The entire sub-path is matched, this would only match filenames ending with etc
It matches:
C:\Windows\System32\drivers\etc
E:\Windows\System32\drivers\etc
F:\backup\2021-05-10\Windows\System32\drivers\etc

path: is not needed when using **
** implies path matching.

For example:
hosts windows** etc**

You could already do the same with:
hosts \windows \etc

windows**etc\hosts

What about a second search bar to search the path?

aviasd
Posts: 120
Joined: Sat Oct 07, 2017 2:18 am

Re: Ignore punctuation + Match path - Everything ignores backslash for matching

Post by aviasd » Fri May 21, 2021 1:02 pm

Hi,
Sorry for the delayed response...
void wrote:
Mon May 10, 2021 10:54 am
Thanks for the feedback aviasd,

There's \: in the latest Everything alpha

(It is undocumented as it is experimental)

For example:

hosts \:windows \:etc

The extra typing of two characters is still a pain..
That's a good idea, I've tried it - as a workaround it's good as most of my searches I usually know the start of folder name so \folder can be used, and when I'm are not sure \: is quicker than path:.
I'm considering an option to allow a single slash to enable match path, eg:
hosts win\ et\
-or-
hosts \ndows \tc
-This will break some useful searches when you want to match the start of filenames.
I see, maybe an option to include both types of results would be acceptable? or a multi-toggle option for the current state, path matching, or both ? (0,1,2)

There's also:
*\hosts
this will find files exactly-named hosts. Unfortunately, it finds files anywhere..
Yep, this one is not good for this scenario

path:windows**etc

The entire sub-path is matched, this would only match filenames ending with etc
It matches:
C:\Windows\System32\drivers\etc
E:\Windows\System32\drivers\etc
F:\backup\2021-05-10\Windows\System32\drivers\etc

path: is not needed when using **
** implies path matching.

For example:
hosts windows** etc*

You could already do the same with:
hosts \windows \etc
yes, but hosts windows** etc* allows partial matching
i.e: hosts **wind**et**
BTW:
Typing this search as hosts$ **windo**et**, is working quite good for me.
it only needs a qualifer for what is the last component ( in the above example - the dollar sign $ )



What about a second search bar to search the path?
That's a good idea as well with the added benefit of having stacking filters to filter folders without having any specific syntax and without enabling the match path globally, but I wonder how intuitive will it be for a new user ( switching back and forth )
:geek: Although, on a second thought, maybe it'll be more intuitive for a new user... I dunno

I'm considering an option to allow a single slash to enable match path, eg:
hosts win\ et\
-or-
hosts \ndows \tc
I would say that I like this idea the most, and I'll probably use it in a nonbreaking fashion in case it's added ( i.e matching both partial folder names and matching the start of filename...
...(although using ^ has already become the new standard for me )

void
Site Admin
Posts: 6880
Joined: Fri Oct 16, 2009 11:31 pm

Re: Ignore punctuation + Match path - Everything ignores backslash for matching

Post by void » Fri May 28, 2021 8:39 am

Everything 1.5.0.1262a adds another option to the match_path_when_search_contains_path_separator2 ini setting to match path and trim the single leading or trailing path separator (\) or (/)

To match paths with a single \ or / and ignore the \ or /:
  • In Everything, type in the following search and press ENTER:
    /match_path_when_search_contains_path_separator2=2
  • If successful, you should see match_path_when_search_contains_path_separator2=2 in the status bar for a few seconds.
The path separator is only removed if there is only one.
For example: \dows will match dows anywhere in the path (the leading path separator is removed).
For example: et\ hosts will match et anywhere in the path (the trailing path separator is removed).
For example: etc\hosts will match etc\hosts in the path (not a leading or trailing path separator, path separator is kept).
For example: \downloads\ will still match \downloads\ in the path (more than one path separator, path separators are kept).


I experimented with options to treat \ as **\** or *\*
However, this means the order of terms is important. (not sure it would be useful?)
For example: indo\et\hosts => **indo**\**et**\**hosts**

aviasd
Posts: 120
Joined: Sat Oct 07, 2017 2:18 am

Re: Ignore punctuation + Match path - Everything ignores backslash for matching

Post by aviasd » Tue Jun 01, 2021 7:07 pm

void wrote:
Fri May 28, 2021 8:39 am


The path separator is only removed if there is only one.
For example: \dows will match dows anywhere in the path (the leading path separator is removed).
For example: et\ hosts will match et anywhere in the path (the trailing path separator is removed).
For example: etc\hosts will match etc\hosts in the path (not a leading or trailing path separator, path separator is kept).
For example: \downloads\ will still match \downloads\ in the path (more than one path separator, path separators are kept).


I experimented with options to treat \ as **\** or *\*
However, this means the order of terms is important. (not sure it would be useful?)
For example: indo\et\hosts => **indo**\**et**\**hosts**
Really cool!
What you mentioned is in fact how I tried to query
I.E when experimenting I tried: win\et\hosts before reading carefully your posts but that did not yield what was expected.
**win**\**et**\**hosts** Did

I think for me it makes sense to search for paths like the above ( indo\et\hosts ), which conforms to cd in zsh. I.E: cd /us/loca/sbi <tab>

Having path matching conform to order has it's merit IMO, specifically when you know part of the path to reach the file in question.

For example:

Another example:
I want to watch a nice series, let's say Futurama but I don't know which episode I'm on.
I start typing futurama and get heaps of non-relevant files.
I know it's under the series folder so I type series\.
Now it's better and looking at the results, I remember that I was on season 2.
I see in the results that the folder name is something like "futurama season s02 ...." so i just type s02 ( Part of the folder name) and now I see what I want.
this could be written much more conveniently as
serie\futu\s02\

Also searching for
win\sys\et\hosts
Should be understandable to every sys-admin imo even if he doesn't know about the feature..

Right now I have to type the query with spaces which is ok, but could be better. That is:
win\ sys\ etc\hosts


I think the above is clearer...

void
Site Admin
Posts: 6880
Joined: Fri Oct 16, 2009 11:31 pm

Re: Ignore punctuation + Match path - Everything ignores backslash for matching

Post by void » Mon Jun 07, 2021 6:57 am

Everything 1.5.0.1263a adds more options to match_path_when_search_contains_path_separator2.

/match_path_when_search_contains_path_separator2=3

will replace \ with *\*
\\ is replaced with **\**

Examples:
win\\hosts
win\32\drive\et\hosts


/match_path_when_search_contains_path_separator2=4

will replace \ with **\**

Examples:
win\hosts
win\32\hosts
win\32\et\hosts


Note: /match_path_when_search_contains_path_separator2=3 or /match_path_when_search_contains_path_separator2=4 doesn't work with regex yet and there might be other quirks when combined with other search options.

I have also improved path matching performance.
Searching for paths should be at-least 2 times faster.

Everything will also now treat / and \ as the same for most path searches (when match diacritics is disabled).

Post Reply