Multiple filters.

Discussion related to "Everything" 1.5 Alpha.
Post Reply
harryray2
Posts: 1050
Joined: Sat Oct 15, 2016 9:56 am

Multiple filters.

Post by harryray2 »

Is it possible, from the sidebar, to use two or more filters at once?
Thanks.
NotNull
Posts: 5261
Joined: Wed May 24, 2017 9:22 pm

Re: Multiple filters.

Post by NotNull »

Yes.

When the Filter list is enabled (Menu => View => Filters), select multiple filters by CTRL-clicking on multiple filters.

For example when selecting Picture as well as audio filter, the resultlist will contain pictures as well as audio files.
(the filters will be OR' ed)



I seem to remeber there was also a setting to AND the filters (result = picture AND audio, which will likely give zero results), but can't find it at the moment.
tuska
Posts: 933
Joined: Thu Jul 13, 2017 9:14 am

Re: Multiple filters.

Post by tuska »

NotNull
Posts: 5261
Joined: Wed May 24, 2017 9:22 pm

Re: Multiple filters.

Post by NotNull »

Good detective work, Sherlock
Thanks!
tuska
Posts: 933
Joined: Thu Jul 13, 2017 9:14 am

Re: Multiple filters.

Post by tuska »

NotNull wrote: Thu Jan 25, 2024 10:13 pm Good detective work, Sherlock
Thanks!
Glad if I could help. :)
harryray2
Posts: 1050
Joined: Sat Oct 15, 2016 9:56 am

Re: Multiple filters.

Post by harryray2 »

Thanks, I did try selecting multiple filters in the sidebar but it doesn't appear to work.

It appears to work with the preset filters such as video, audio, executable etc, but doesn't appear to work when I choosing the filters that I've created.
tuska
Posts: 933
Joined: Thu Jul 13, 2017 9:14 am

Re: Multiple filters.

Post by tuska »

harryray2 wrote: Mon Jan 29, 2024 4:53 pm It appears to work with the preset filters such as video, audio, executable etc,
but doesn't appear to work when I choosing the filters that I've created.
I can confirm this with this example.
  1. Menu "View" - "Folders"
  2. The cursor focus is on D:\Bilder\ (Bilder = Pictures)
  3. Filter "Everything" is shown
  4. Switch to Filter "Dateiausschlüsse... !<D:|I:|J:|N:> ..." [English: File exclusions]
    and replace the "Everything" filter with a drop-down selection.
    0 items (0 files, 0 folders) -> Drive D: was excluded from the search!
    1. The cursor focus is in the search box
    2. The "Pictures" folder is highlighted
  5. Switch to the "Picture" filter (Filter 1) via the "Search" menu
    1. Only pictures are displayed
    2. The cursor focus is in the search box
    3. The "Pictures" folder is highlighted
  6. Everything is OK so far!
     
  7. Call up the second filter via the "Search" menu
    Hold down the Ctrl key and click on the filter "Dateiausschlüsse... !<D:|I:|J:|N:> ..." [English: File exclusions]
  8. In the "Search" menu, you can now see that both filters have been selected
     
  9. Bug
    1. Filter 2: Search: !<D:|I:|J:|N:> ... Columns: (No change) ... Sort: (No change) ... View: (No change)
    2. After this filter (Filter 2 -> !<D:|I:|J:|N:>) was added to the "Pictures" filter (Filter 1)
      the pictures continued to be displayed although the D: drive was excluded from the search. :!:
    3. The filter "Dateiausschlüsse... !<D:|I:|J:|N:> ..." [English: File exclusions]
      is now displayed as the last used filter in the top right-hand corner of the filter drop-down field.
    4. The cursor focus is in the search box
    5. The "Pictures" (="D:\Bilder") folder is highlighted
Last edited by tuska on Mon Jan 29, 2024 10:47 pm, edited 1 time in total.
harryray2
Posts: 1050
Joined: Sat Oct 15, 2016 9:56 am

Re: Multiple filters.

Post by harryray2 »

Thanks, I've tried my custom filters DC:last10mins' with 'search on all drives except c:' and 'exclude Firefox and Tor'. All these filters work fine individually, but not together.

If I use the 'compressed' and 'folder' and 'file' (which I think was already on Everything, as I can't remember putting them in myself), the multi filters work fine.
void
Developer
Posts: 15352
Joined: Fri Oct 16, 2009 11:31 pm

Re: Multiple filters.

Post by void »

the pictures continued to be displayed although the D: drive was excluded from the search. :!:
Everything will OR multiple filters by default.

picture OR exclude-filter



You will need to add and-filter: to your exclude filter:

and-filter: !<D:|I:|J:|N:>
tuska
Posts: 933
Joined: Thu Jul 13, 2017 9:14 am

Re: Multiple filters.

Post by tuska »

2void

Thank you, I should have known that :?

Code: Select all

and-filter: !<D:|I:|J:|N:>
works!

However, I find it difficult to get used to the idea that I first have to change the parameters in the filter(s)
when I select two filters from the menu, for example.

I now have to check several filters to see whether I might have to prefix them with the command "and-filter: ".
Mmhh.

I am not yet sure whether I would prefer AND instead of OR as the default for the filters
if they are selected via the "Search" menu.
At least there are already three users who would have expected an AND as the default instead of an OR.

If you select a filter via dropdown, then you would have OR as the default.
---------------------
Apart from that, the meaning of OR in this context is not clear to me.

Example 1 - OR:
Menu "Search" shows the filters "Audio" AND "Video" selected.
Both audio and video files are displayed.

Example 2 - OR:
Menu "Search" shows the filters "Picture" AND "!<D:|I:|J:|N:>"
The filter "!<D:|I:|J:|N:>" is NOT taken into account.
The filter is only ignored because from Exclusion: Search: !<D:|I:|J:|N:> is present resp. default = OR.

Example 3 - AND
Menu "Search" shows the filters "Picture" AND "and-filter: !<D:|I:|J:|N:>"
Both filters are taken into account.

For me, a filter means narrowing down the search.

If I can do this with two or more filters - without having to set special parameters in the filters -
I would see this as an advantage.
harryray2
Posts: 1050
Joined: Sat Oct 15, 2016 9:56 am

Re: Multiple filters.

Post by harryray2 »

I'm a bit baffled by this, are you saying that when choosing multiple filters, they aren't all enabled?
How do I enable AND, when choosing multiple filters in the sidebar, so that all the filters are taken into consideration?

Update:
I think I've got this, adding and-filter: to the filters seems to work, but isn't there a way to make AND the default, without having to change every filter?
Would adjusting the operator precedence in options achieve this?
tuska
Posts: 933
Joined: Thu Jul 13, 2017 9:14 am

Re: Multiple filters.

Post by tuska »

harryray2 wrote: Tue Jan 30, 2024 12:37 pm Would adjusting the operator precedence in options achieve this?
No.

A change

Code: Select all

FROM: Operator precedence: OR  > AND (default)
TO  : Operator precedence: AND > OR  (non-default)
results in filter 2 .....: !<D:|I:|J:|N:> -> WITHOUT "and-filter: " to NOT produce the desired result either.

Furthermore, it should not be necessary to change this setting for two or more filters.
harryray2
Posts: 1050
Joined: Sat Oct 15, 2016 9:56 am

Re: Multiple filters.

Post by harryray2 »

Apologies if I'm being a bit dense about this,
I tried the and:filter on 4 filters, and it appears to work, so if there is no quicker option it looks like I will have to change each filter individually.
I'm also wondering if putting in the and-filter: will have any unexpected results.

I also just tried putting the and-filter: on a couple of filters, which appeared to work OK, but if I then included another filter, that didn't have the and=filter: I got some strange results.

In general, but not always, the filters I would be most likely to use together would be a Date modified filter, excluding certain files and folders, and a include or exclude drive filter.

It would be nice to have a fast way of switching the default from OR to AND and vice-versa.
void
Developer
Posts: 15352
Joined: Fri Oct 16, 2009 11:31 pm

Re: Multiple filters.

Post by void »

Everything 1.5.0.1367a adds a filter-group: search function to group filters.

Filters in the same group are ORed.
Filter groups are ANDed.
If the filter group is not specified the unnamed filter group is used.



I will leave and-filter: as it is useful for some searches that should always be anded.

For example, exclusion searches:

!D:



and-filter: will override any filter group.



To set the filter group, add the following to the filter search:

filter-group:"My Filter Group"

I recommend placing any 'location' filters into a location group.

For example:

filter-group:location c:


If you find this useful, please let me know.
I am considering adding the filter group to the filter UI.
harryray2
Posts: 1050
Joined: Sat Oct 15, 2016 9:56 am

Re: Multiple filters.

Post by harryray2 »

Sorry David, not sure if I'm being dense, but I just don't get this.

When I try to combine several filters in the sidebar, it doesn't work.
Am I missing something?
void
Developer
Posts: 15352
Joined: Fri Oct 16, 2009 11:31 pm

Re: Multiple filters.

Post by void »

Could you please give an example of your filter selection.
harryray2
Posts: 1050
Joined: Sat Oct 15, 2016 9:56 am

Re: Multiple filters.

Post by harryray2 »

Thanks, I'll start with a relatively simple example...

If I use the sidebar, highlight multiple filters by using the ctrl key, and chose some inbuilt filters, such as audio,compressed and video together it appears to work. Everything shows me mp4, mp3, rar files etc.
About 23,000 files altogether

If I then include one of my own filters, a basic filter to exclude files on my D: drive, rather than reduce the amount of results, Everything shows a lot more items (262,294), and doesn't exclude the filed on my D: drive.

I did try putting in the and-filter: into my exclude D: filter, and this appeared to work, and I end up with around 9000 items. Does this mean that I would have to go through all my filters, and include and-filter: in all of them?

I have no idea why choosing multiple inbuilt filters work, whilst my own filters don't.
void
Developer
Posts: 15352
Joined: Fri Oct 16, 2009 11:31 pm

Re: Multiple filters.

Post by void »

You will need to add and-filter: to all your custom exclusion filters.

For example:

!d:
=>
and-filter: !d:



Everything cannot determine if your filter is an inclusion only filter or an exclusion filter.
Everything will treat all filters as inclusion only filters by default.
You will need to specify and-filter: for exclusion filters.

I will experiment some more with treating filters as exclusion filters if they start with !
harryray2
Posts: 1050
Joined: Sat Oct 15, 2016 9:56 am

Re: Multiple filters.

Post by harryray2 »

Thanks, it's a bit of a chore, but I'll have to go through all the filters. I assume there's no quick way of doing this except to go through the filters one by one?
void
Developer
Posts: 15352
Joined: Fri Oct 16, 2009 11:31 pm

Re: Multiple filters.

Post by void »

If you exit Everything (File -> Exit)
You can edit your %APPDATA%\Everything\Filters.csv directly.
harryray2
Posts: 1050
Joined: Sat Oct 15, 2016 9:56 am

Re: Multiple filters.

Post by harryray2 »

Brill...Thanks.
harryray2
Posts: 1050
Joined: Sat Oct 15, 2016 9:56 am

Re: Multiple filters.

Post by harryray2 »

I forgot to ask, by adding and-filter: to the start of the filters, does it affect the operation of the filter in any way, when using the filter normally?
void
Developer
Posts: 15352
Joined: Fri Oct 16, 2009 11:31 pm

Re: Multiple filters.

Post by void »

and-filter: will do nothing when a single filter is selected.

Do a lot of your filters start with !

I am going to trial treating filters starting with ! as and-filters in a future update..
Post Reply