I'd like to set up a 'filter', such that...

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
therube
Posts: 4977
Joined: Thu Sep 03, 2009 6:48 pm

I'd like to set up a 'filter', such that...

Post by therube »

I'd like to set up a 'filter', or similar, such that...
> "| master-"
is added to the search string.
And that is with | to mean, OR.

So if I select that Filter, lets call it Master,
& I search for:
> red
the search will be interpreted as
> red | master-

Can that be done?
ovg
Posts: 294
Joined: Thu Oct 27, 2016 7:19 pm

Re: I'd like to set up a 'filter', such that...

Post by ovg »

Open Edit Filter,

search: search:|master-
macro: <search>
Capture.PNG
Capture.PNG (24.26 KiB) Viewed 7563 times
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: I'd like to set up a 'filter', such that...

Post by Stamimail »

I don't know why it works, and why should it. Is this documented somewhere?
Anyway, according to my tests, you don't have to use the string "search".

search: anything:|master-
macro: <anything>

This kind of action, the ability to add a search to current search, should be added to Bookmarks (then, you will see it also in SearchBox).
ovg
Posts: 294
Joined: Thu Oct 27, 2016 7:19 pm

Re: I'd like to set up a 'filter', such that...

Post by ovg »

Hmm
What is the difference? I didn't understand ...
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: I'd like to set up a 'filter', such that...

Post by Stamimail »

I meant "search:" is not a preserved macro/function, to get the current search.
You can also do

search: A:|master-
macro: <A>

search: B:|master-
macro: <B>
therube
Posts: 4977
Joined: Thu Sep 03, 2009 6:48 pm

Re: I'd like to set up a 'filter', such that...

Post by therube »

Thank you.

I didn't understand it then & still trying to wrap my head around it, but...

Filter functions
http://www.voidtools.com/forum/viewtopic.php?f=5&t=5781
ovg
Posts: 294
Joined: Thu Oct 27, 2016 7:19 pm

Re: I'd like to set up a 'filter', such that...

Post by ovg »

Stamimail wrote:I meant "search:" is not a preserved macro/function, to get the current search.
Aha! Yes, of course.
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: I'd like to set up a 'filter', such that...

Post by NotNull »

therube wrote: I didn't understand it then & still trying to wrap my head around it, but...
Maybe this can help:

As your search query can be anywhere, like path:"search query" or "search query" | Master-, you need a variable to address your search query (the one you enter in the search bar), like %1 in CMD.
(How else would Everything know *where* to inject your search query?)

For this example, lets call this variable MySearchQuery.

Now, when you define your filter like this:
2018-04-14 15_16_17-Edit Filter.png
2018-04-14 15_16_17-Edit Filter.png (5.7 KiB) Viewed 7535 times
With the MASTER filter enabled, you can search for red (which means that MySearchQuery=red) and the actual search will be for
red|blue
If you don't enable the Filter, you can still use the macro and search for master:red , which will then be replaced with: red|blue.
This is the same idea as Regex search modifier vs regex:....


Don't get confused by the <> and : (<MySearchQuery> resp. MySearchQuery: ) They are just there to differentiate the variable (MySearchQuery) from normal searchtext
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: I'd like to set up a 'filter', such that...

Post by Stamimail »

Thank you very much NotNull for making it more simple and understandable.

I think the solution/implementation can be much more simpler to get what we are asking for.
Instead of defining a variable in Macro,
Everything can simply have a new function that will get the Current Search.
For Example: Let's call this function for now "cs:".

So that,

In @therube and @ovg example, it will be:
Name: Test
Search: cs:|master-
Macro: [empty]

in @NotNull example, it will be:
Name: Master
Search: cs:|blue
Macro: master

and therefore, for the other thread, it will be:

utf8content:cs: | ansicontent:cs:

Search: regex:"(?:\b|_)cs:(?:\b|_)"
Macro: ww

Name: parent
Search: parent:cs:
Macro: myparent


All solved by one new function.
therube
Posts: 4977
Joined: Thu Sep 03, 2009 6:48 pm

Re: I'd like to set up a 'filter', such that...

Post by therube »

Next part of the equation.

How do you add a Filter into the mix?
Such that if you only wanted audio:, the Search Filter would find something like:

audio: < red | master- >

Now you can manually add audio: to the search line, but I'd like to avoid that.
I'd only like to enter, red, as the search.
ovg
Posts: 294
Joined: Thu Oct 27, 2016 7:19 pm

Re: I'd like to set up a 'filter', such that...

Post by ovg »

Add to Search: ext:mp3;wma;........
capture.PNG
capture.PNG (24.58 KiB) Viewed 7503 times
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: I'd like to set up a 'filter', such that...

Post by Stamimail »

If I understood correctly,
you are talking about a case, that the user type in SearchBox:
red

and he wants to add to this search:
OR master-
and to get only audio files.

That means he needs to do like this:
audio: < cs: | master- >
audio: cs: | master-
(both should work for this case)

If the user will add this to a Filter Search, the SearchBox will remain the same ("red"), and the action will affect only the results.
If the user will add this to a Bookmark Search, the SearchBox will be changed to:
audio: < red | master- >
audio: red | master-
therube
Posts: 4977
Joined: Thu Sep 03, 2009 6:48 pm

Re: I'd like to set up a 'filter', such that...

Post by therube »

If I understood correctly
Precisely.
audio: < cs: | master- >
That would be my thought too, but I don't seem to be getting any results?
Not master-.mp3, not red.mp3


In the Search Filter, I have:
Search: audio: < cs: | master- >
Macro: <cs>


(I'll have to look at the ext: variation, later.)
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: I'd like to set up a 'filter', such that...

Post by Stamimail »

It seems like a bug.

I tried
Macro: test<cs>

and prefix in SearchBox
test:red

and it works.
Post Reply