Filter functions

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
void
Site Admin
Posts: 4551
Joined: Fri Oct 16, 2009 11:31 pm

Filter functions

Post by void » Thu Nov 03, 2016 9:34 am

A filter function is a special filter macro that takes one parameter that can dynamically build a filter search.

Filter functions have been added to 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

To create a filter function, append the filter macro name with:
<name>

All occurrences of name: in the filters search will be substituted with the parameter passed to your macro.

For example, to search for files with the content "foo bar", where the files could be utf8 or ansi, you would have to search for:
utf8content:"foo bar" | ansicontent:"foo bar"

With filter functions, you can create a filter (from Search -> Add to filters...) with the macro:
ct<search>

and with the filter search:
utf8content:search: | ansicontent:search:

when searching for ct:"foo bar" the search will be replaced with:
utf8content:"foo bar" | ansicontent:"foo bar"

mwsm
Posts: 21
Joined: Thu Feb 28, 2013 2:01 am

Re: Filter functions

Post by mwsm » Thu Nov 03, 2016 11:39 pm

This is an excellent and powerful new feature! For example, I am now able to create a custom Whole Word filter that includes the underscore character as a word boundary, something I've long missed in Everything. I set up the Filter like this:

Code: Select all

Search: regex:"(?:\b|_)word:(?:\b|_)"
Macro: ww<word>
Thank you!

harryray2
Posts: 100
Joined: Sat Oct 15, 2016 9:56 am

Re: Filter functions

Post by harryray2 » Sun Nov 06, 2016 10:28 am

I'm probably being dense, I don't quite get it....is it possible to put a screenshot up with an example?

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

Re: Filter functions

Post by void » Mon Nov 07, 2016 9:03 am

The search is now used as the filter parameter when a filter with a macro function is active in Everything 795b:
http://www.voidtools.com/Everything-1.4.1.795b.x86.zip
http://www.voidtools.com/Everything-1.4.1.795b.x64.zip

For example, if you have the filter with the search:
parent:search:
and the macro:
myparent<search>

When this filter is active, the search: part is substituted with the current search.
So when searching for c:\windows with the parent filter active, the search is replaced with:
parent:c:\windows

Image
Image

hansolocambo
Posts: 2
Joined: Mon Oct 09, 2017 9:30 am

Re: Filter functions

Post by hansolocambo » Mon Oct 09, 2017 9:35 am

I'm sure this is extremely powerful and even "simple", but sadly it's not accessible to the "ordinary people" who never write a line of code and are used to intuitive UIs with cells to be filled in. :oops:

horst.epp
Posts: 161
Joined: Fri Apr 04, 2014 3:24 pm

Re: Filter functions

Post by horst.epp » Mon Oct 09, 2017 1:06 pm

hansolocambo wrote:I'm sure this is extremely powerful and even "simple", but sadly it's not accessible to the "ordinary people" who never write a line of code and are used to intuitive UIs with cells to be filled in. :oops:
There is no code to write and the examples above are easy to follow even for beginners.
If that is to much you should probably stay with Windows search or only use the basic Everything features.

Stamimail
Posts: 681
Joined: Sat Aug 31, 2013 9:05 pm

Re: Filter functions

Post by Stamimail » Thu Jun 28, 2018 7:15 pm

There is no code to write and the examples above are easy to follow even for beginners.
I don't think so.
Anyway,
<search>
search:
This Syntax where was it taken from? What was its inspiration?

Post Reply