Rules for Filter Search Field

General discussion related to "Everything".
Post Reply
mwsm
Posts: 21
Joined: Thu Feb 28, 2013 2:01 am

Rules for Filter Search Field

Post by mwsm »

Are there specific rules for what works in the Filter > Search field? I have not found many details in the documentation or the forum. For example:

Code: Select all

case:ABC
regex:ABC
both work, but the case is ignored; and:

Code: Select all

regex:"^ABC"
regex:"[A-Z]"
both return zero results (for me). Am I missing something? I'm supposing that some modifiers do not apply in the Filter > Search field?

Tested in v1.4.0.713b and v1.4.1.787b, in Windows 7 x64.

(I realise that Bookmarks are generally a better fit for complex saved searches.)
void
Developer
Posts: 16671
Joined: Fri Oct 16, 2009 11:31 pm

Re: Rules for Filter Search Field

Post by void »

The filter search works exactly the same way as your normal search does.

The filter search options, such as match case work exactly the same as a normal search does with enabling a search option from the Search menu.

Modifiers can be used exactly the same as a normal search.

case:ABC
regex:ABC
regex:"^ABC"
regex:"[A-Z]"

All are working correctly here, have you set a filter or bookmark to use case or regex as a macro?

Could you please run Everything in debug mode and try researching:
  • In Everything, press Ctrl + `
  • Select the Everything filter from the Search menu.
  • Reselect your filter from the Search menu.
  • What is displayed in the Debug console?
You should see some text in green like:

Code: Select all

search '' filter 'regex:"[A-Z]"' sort 5
therube
Posts: 4955
Joined: Thu Sep 03, 2009 6:48 pm

Re: Rules for Filter Search Field

Post by therube »

(collision, i see, posting anyhow...)


Search -> Organize Filters

Match case
Regex
Search: ^ABC
OK

Search: case:regex:"^ABC"
OK

Search: case: regex:"^ABC"
X

Rules?
Not sure if they're about anywhere or not?
mwsm
Posts: 21
Joined: Thu Feb 28, 2013 2:01 am

Re: Rules for Filter Search Field

Post by mwsm »

void wrote:The filter search works exactly the same way as your normal search does.

The filter search options, such as match case work exactly the same as a normal search does with enabling a search option from the Search menu.

Modifiers can be used exactly the same as a normal search.
Thanks for the notes.
void wrote:All are working correctly here, have you set a filter or bookmark to use case or regex as a macro?
Good theory, but nope.
void wrote:What is displayed in the Debug console?
Ah, I see the issue. A filter search like:

Code: Select all

case:regex:"^[A-Z]"
displays this in the Debug console when selected from the Search menu:

Code: Select all

search '' filter 'case:regex:"^[A-Z]"' sort 2
and works as expected. However, when run as a macro it displays this in the Debug console:

Code: Select all

search 'nocase:nopath:nowholeword:nodiacritics:noregex:<case:regex:"^[A-Z]" >' filter '' sort 2
and doesn't return any results - perhaps because the "nocase:" and "noregex:" disable the "case:" and "regex:" in the search.

However, if "Match case" and "Regex" are checked in the Edit Filter dialog then the search also works as expected with a macro.

Not sure if this qualifies as a bug, or just a misunderstanding on my part. I generally rely on the search fields only and seldom use the menu items, so I might have missed this.

@therube: Thanks for looking into this also.
void
Developer
Posts: 16671
Joined: Fri Oct 16, 2009 11:31 pm

Re: Rules for Filter Search Field

Post by void »

Thanks for the reply.

I've changed Everything so it correctly applies filter modifiers in Everything 1.4.1.790b, if you wish to try this now, please download Everything 1.4.1.790b:
http://www.voidtools.com/Everything-1.4.1.790b.x86.zip
http://www.voidtools.com/Everything-1.4.1.790b.x64.zip
search 'nocase:nopath:nowholeword:nodiacritics:noregex:<case:regex:"^[A-Z]" >' filter '' sort 2
Everything now uses:
nofiltercase:nofilterpath:nofilterwholeword:nofilterdiacritics:nofilterregex:<case:regex:"^[A-Z]" >
These filter modifiers only effect the initial filter flags and can be overridden with an appending modifier.

I've also added filter functions.
mwsm
Posts: 21
Joined: Thu Feb 28, 2013 2:01 am

Re: Rules for Filter Search Field

Post by mwsm »

Thank you very much! Filter macros work perfectly in 790b.
Post Reply