Make "startwith" option work specifically with the filename even when "match path" is enabled, not the full path

Have a suggestion for "Everything"? Please post it here.
Post Reply
Dariush
Posts: 19
Joined: Sat Apr 01, 2017 2:41 pm

Make "startwith" option work specifically with the filename even when "match path" is enabled, not the full path

Post by Dariush »

Assume we have "match path" enabled. Currently the startwith option requires you to enter the path starting with the drive; however, when you actually have a path starting with the drive, you don't need this option anyway, since you cannot have ":" anywhere else in the path, other than next to the drive, thus making this option useless, as far as I understand. Conversely, as far as I understand, there is currently no way to search for the _filenames_ beginning with a certain string, and therefore I suggest making this option work with filenames instead.
void
Developer
Posts: 15096
Joined: Fri Oct 16, 2009 11:31 pm

Re: Make "startwith" option work specifically with the filename even when "match path" is enabled, not the full path

Post by void »

Added to my TODO list: Add a basenamestartwith: (bnsw:) search function and stemstartwith: (ssw:) search function.

I will consider making startwith: match only the basename (not the path) by default.

Thanks for the suggestion.

For now, please try the following macro:
  • In Everything, from the Search menu, click Add to filters....
  • Change the Name to:
    Base Name Start With
  • Change the Search to:
    nopath:startwith:search:
  • Change the Macro to:
    bnsw<search>
  • Click OK.
  • Click OK.
Instead of using startwith: use bnsw:
bnsw will be replaced with the nopath: modifier and startwith: modifier.
NotNull
Posts: 5167
Joined: Wed May 24, 2017 9:22 pm

Re: Make "startwith" option work specifically with the filename even when "match path" is enabled, not the full path

Post by NotNull »

Dariush wrote: Sun Jun 14, 2020 8:39 pm Conversely, as far as I understand, there is currently no way to search for the _filenames_ beginning with a certain string, and therefore I suggest making this option work with filenames instead.
Just disable "Match Path" and startswith: will work on the filename instead of working on the entire path as you experience now.

A good (better, imo) for using "Match Path" is using a "\" in your search query [1]. Example:

2020-06-15 11_43_19-_te   startwith_zz - Everything.png
2020-06-15 11_43_19-_te startwith_zz - Everything.png (25.6 KiB) Viewed 7928 times

[1] Assuming Match path when a search term contains a path separator is enabled under MEnu:Tools > Options > Search
Dariush
Posts: 19
Joined: Sat Apr 01, 2017 2:41 pm

Re: Make "startwith" option work specifically with the filename even when "match path" is enabled, not the full path

Post by Dariush »

I know that I can disable the "match path" option. My point is that when it _is_ enabled, there's no point in using startwith (unless I'm missing something), and therefore it can be safely overridden. Basically, save the user unnecessary busywork. :)
NotNull
Posts: 5167
Joined: Wed May 24, 2017 9:22 pm

Re: Make "startwith" option work specifically with the filename even when "match path" is enabled, not the full path

Post by NotNull »

Dariush wrote: Mon Jun 15, 2020 12:36 pm (unless I'm missing something)
When you write a script/program that uses Everything, you want predictable results. Not influenced by some sort of "intelligence" that decides for you that you want something else than you asked for ("Do what I say" vs. "Do what I want") [1]

Using the Everything GUI that is less of a problem.


[1] I struggle with devices/software/... that *think* they know what I want. 90% of the time I want something else ...
Dariush
Posts: 19
Joined: Sat Apr 01, 2017 2:41 pm

Re: Make "startwith" option work specifically with the filename even when "match path" is enabled, not the full path

Post by Dariush »

TBH I don't think the idea "startwith always works with the filename" is so complex or unpredictable that it qualifies as the software "deciding for you that you want something". Even the documentation says this about this function:
startwith:<text> Search for filenames starting with text.
Last I checked, "filename" is not the same thing as "path". :) If anything, this change would bring the functionality in line with what the documentation says and what the users would expect based on it.
NotNull
Posts: 5167
Joined: Wed May 24, 2017 9:22 pm

Re: Make "startwith" option work specifically with the filename even when "match path" is enabled, not the full path

Post by NotNull »

Dariush wrote: Mon Jun 15, 2020 4:09 pm Last I checked, "filename" is not the same thing as "path".
Well, technically, c:\path to\basename.extension is called the fully qualified filename ..

When you enable Match Path, it will search in the fully qualified filename instead of in name.extension.

Your reasoning reversed:
I don't think the idea that "Match Path always searches in the fully qualified filename" is so complex or unpredictable that it has to be changed.


But you are implicitly right about one thing: Everything is a mainstream application that (my interpretation) wants to make searching for files as "human" as possible. And seen in that light, changing the behaviour of Match Path and/or startwith: might be an option.
On the other hand: there are probably quite a few conflicting "do what I want" search combinations that also should be handled then.
void
Developer
Posts: 15096
Joined: Fri Oct 16, 2009 11:31 pm

Re: Make "startwith" option work specifically with the filename even when "match path" is enabled, not the full path

Post by void »

Currently, the documentation is wrong.

startwith: is not a search function. It is a search modifier.
It tells Everything to use a start-with comparison check for the current search term.
The current search term could refer to a filename, full path or even file content.

The current plan is to add the following search functions:
basenamestartwith: and stemstartwith:

I will consider changing startwith: to a search function to search only the basename only, as searching the full path is not too useful.
It is useful for file content, eg: startwith:content:"this line is at the top of the file" or startwith:title:"Something In The"

Perhaps the path modifier could be disabled when using the startwith: modifier..
I would like to try and avoid special cases, eg: what happens with the case: modifier? should this only effect the search on the basename?

The Match Path option is also a search modifier, it tells the search term to refer to the full path and filename.
Hopefully this explains what is going on behind the scenes a little..
A.M
Posts: 1
Joined: Sat Jan 19, 2019 11:03 am

Re: Make "startwith" option work specifically with the filename even when "match path" is enabled, not the full path

Post by A.M »

Two macros:
"BaseName Starts With",0,0,0,0,0,"nopath:startwith:search:","&&<search>",
"Ends With ",0,0,0,0,0,"nopath:endwith:search:","$$<search>",
have solved partly the issue.
It will be useful to have <basename> modifier in order to use startwith & endwith consistently.

Regards.
Post Reply