Suggest: Add "match-path:" modifier verb to turn on Match Path

Discussion related to "Everything" 1.5.
Post Reply
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Suggest: Add "match-path:" modifier verb to turn on Match Path

Post by raccoon »

The verb nopath: can be used to modify a single search term to turn off "Match Path".
nopath: cannot be used as a global modifier for an entire search query. (Please allow this, too.)

Please add the verb match-path: to turn on "Match Path" for a single search term or for an entire search query.
Similarly no-match-path as a global modifier or single-term modifier.

Examples below.

The quick brown fox match-path: --> Asserts that "Match Path" is used for the entire search query.
match-path: The quick brown fox --> Asserts that "Match Path" is used for the entire search query. (note the space between "match-path:" and "The")

match-path:The quick brown fox --> Asserts that "Match Path" is used only for the word "The" and the rest of the search query uses the default Match Path setting.

match-path:The match-path:quick match-path:brown nopath:fox ...
match-path:The match-path:quick match-path:brown no-match-path:fox ...
match-path:<The quick brown> no-match-path:fox ...
The words "The" and "quick" and "brown" must appear anywhere in the path or object name, but the word "fox" must appear in the object-name (file or folder) and not just anywhere in the object's path.

Please allow nopath: to work as a global modifier the same as no-match-path: if it stands alone separated by spaces.
void
Developer
Posts: 19870
Joined: Fri Oct 16, 2009 11:31 pm

Re: Suggest: Add "match-path:" modifier verb to turn on Match Path

Post by void »

Use the :: prefix to enable a search modifier globally.

For example, to disable match path for the rest of the search:
::nopath:


Note: global modifiers will only apply to search terms to the right of the modifier.

I will consider a match-path: alias for path:
Thanks for the suggestion.
runmode
Posts: 50
Joined: Sat May 27, 2023 11:22 pm

Re: Suggest: Add "match-path:" modifier verb to turn on Match Path

Post by runmode »

Hi,
testing the global search modifier ::path: doesn't work as expected for me, with Version 1.5.0.1408a (x64):

Sample path:
D:\TMP\fruits\cherry.txt

Starting with match path deactivated from the menu,
::path: cherry fruit
does not match.

Maybe something wrong with my settings?
void
Developer
Posts: 19870
Joined: Fri Oct 16, 2009 11:31 pm

Re: Suggest: Add "match-path:" modifier verb to turn on Match Path

Post by void »

The :: prefix was changed to reference the internal modifier.

Please use the ? prefix to enable a search modifier globally.

For example:

?nopath:
runmode
Posts: 50
Joined: Sat May 27, 2023 11:22 pm

Re: Suggest: Add "match-path:" modifier verb to turn on Match Path

Post by runmode »

Thank you for your quick reply, it was so helpful!

In viewtopic.php?p=75868#p75868, my I ask you to explain a litte deeper how to use the new modifyers,
maybe with examples?

What is the 'built-in modifier' where ::path: now referrs to, and what is the new function of ::path: ?
How would path*: treat the rest of the search literally? What does that mean?

At this occasion, let me thank you for this software which is just great!
runmode
Posts: 50
Joined: Sat May 27, 2023 11:22 pm

Re: Suggest: Add "match-path:" modifier verb to turn on Match Path

Post by runmode »

I did some reading, and I hope my conclusion is correct, that

- in the case a macro named "path" is defined by the user
::path: would call the built-in modifier path:, while
path: would call the macro?

- in the case wildcards are used in a search string
path*: would escape all wildcards in the search string, while
path:"..." would still resolve the wildcards within the quotation marks (that are used to handle blanks)?
void
Developer
Posts: 19870
Joined: Fri Oct 16, 2009 11:31 pm

Re: Suggest: Add "match-path:" modifier verb to turn on Match Path

Post by void »

Thank you for your feedback runmode,
my I ask you to explain a litte deeper how to use the new modifyers,
maybe with examples?
Please ask here.


What is the 'built-in modifier' where ::path: now referrs to, and what is the new function of ::path: ?
path: can be replaced with a user macro (bookmark or filter).
::path: will always refer to the original path modifier.


How would path*: treat the rest of the search literally? What does that mean?
It means anything after path*: is treated literally.
Operators are no longer interpreted, eg: space is treated as a literal space instead of the AND operator.

An example:

path*:program files


This will find files/folders that have "program files" in the full path.
The space above is treated literally.


- in the case a macro named "path" is defined by the user
::path: would call the built-in modifier path:, while
path: would call the macro?
Correct.


- in the case wildcards are used in a search string
path*: would escape all wildcards in the search string
Not quite, path*: will still match any specified wildcards.
Any text after path*: is treated literally. -You cannot use any more search functions, search modifiers or operators.

An example:

path*:C:\Program Files\*


will match files/folders directly in C:\Program Files.


path:"..." would still resolve the wildcards within the quotation marks (that are used to handle blanks)?
wildcards are still applied, even when quoted.

An example:

path:"C:\Program Files\*"


will match files/folders directly in C:\Program Files.



If you are looking to disable wildcards, prefix your search with nowildcards:

An example:

nowildcards:foo?bar


The ? is treated as a literal ?

Although, Windows doesn't really allow ? or * in filenames..
runmode
Posts: 50
Joined: Sat May 27, 2023 11:22 pm

Re: Suggest: Add "match-path:" modifier verb to turn on Match Path

Post by runmode »

Thank you for your explainations and examples, everything clear for me now.

BTW: to achieve the nice green letters on white background with a borderline, is there a BBCode for the CSS class available for normal forum users?
void
Developer
Posts: 19870
Joined: Fri Oct 16, 2009 11:31 pm

Re: Suggest: Add "match-path:" modifier verb to turn on Match Path

Post by void »

There's two code style BBCode options:

[code]
foo bar
[/code]

=>

Code: Select all

foo bar
-or-

inline [c]foo bar[/c] example

=>

inline
foo bar
example
Post Reply