How to only return Nth number of items per sub folder?

Discussion related to "Everything" 1.5 Alpha.
Post Reply
Ralf_Reddings
Posts: 122
Joined: Fri Mar 24, 2023 4:53 pm

How to only return Nth number of items per sub folder?

Post by Ralf_Reddings »

I have a list of files inside
c:temp
like so:

Code: Select all

C:\temp\blue\1.GIF
C:\temp\blue\3.MP4
C:\temp\blue\2.JPG
C:\temp\blue\4.PDF
C:\temp\blue\5.MD

C:\temp\green\1.GIF
C:\temp\green\2.JPG
C:\temp\green\3.MP4
C:\temp\green\4.PDF
C:\temp\green\5.MD

C:\temp\red\1.GIF
C:\temp\red\2.JPG
C:\temp\red\3.MP4
C:\temp\red\4.PDF
C:\temp\red\5.MD
I would like to limit how many items are returned, for all sub folders.
Searching
Path-list:c:\temp
returns all of the items. I would like to only get the first three items of every folder only. So instead of the above results, something like the following:

Code: Select all

C:\temp\blue\1.GIF
C:\temp\blue\2.JPG
C:\temp\blue\3.MP4

C:\temp\green\1.GIF
C:\temp\green\2.JPG
C:\temp\green\3.MP4

C:\temp\red\1.GIF
C:\temp\red\2.JPG
C:\temp\red\3.MP4
I tried
count:
but this seems to limit the total count of items shown and it seems to apply after the items are found.

I suppose "Nth number of items per folder" is relative to a property, so either by alphabetical order or by date modified would be fine with me.
NotNull
Posts: 5517
Joined: Wed May 24, 2017 9:22 pm

Re: How to only return Nth number of items per sub folder?

Post by NotNull »

Not possible.
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: How to only return Nth number of items per sub folder?

Post by void »

I have put on my TODO list to add a dupecount: search function.

Thank you for the suggestion.

This might look something like:

dupe:path dupecount:3
Ralf_Reddings
Posts: 122
Joined: Fri Mar 24, 2023 4:53 pm

Re: How to only return Nth number of items per sub folder?

Post by Ralf_Reddings »

@Void
@NotNull

I should be clear I am not looking to find duplicates. The file names sharing similar names is incidental. I am merely looking to limit each folders
child items to an Nth count.

Normally, when you search for folders in Everything,
Path-list:C:\temp\blue;C:\temp\red;C:\temp\green
, it will return all of the child items. So if every folder has 100 items, you will end up getting around 300.

So instead of getting inundated with 300+ items. I am instead, after a solution that would only return 3 items per folder, this could be the 3 most recently modified items.

So with a pseudo function like
limit-children:
would force every folder (and child folders too?) to only contribute 3 items to the total items found:

Code: Select all

Path-list:C:\temp\blue;C:\temp\red;C:\temp\green limit-children:3
I hope I am explaining myself better and not just causing further confusion.
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: How to only return Nth number of items per sub folder?

Post by void »

I will consider a limit-children: search function.

Thank you for the suggestion.



I will also consider a distinct-count: search function.

limit-children:3 would be the same as distinct:path distinct-count:3

limit-children:1 would be the same as distinct:path
distinct:path is already implemented.
Ralf_Reddings
Posts: 122
Joined: Fri Mar 24, 2023 4:53 pm

Re: How to only return Nth number of items per sub folder?

Post by Ralf_Reddings »

Thats great to hear, cheers!
kingkong
Posts: 1
Joined: Sat Aug 10, 2024 1:17 pm

Re: How to only return Nth number of items per sub folder?

Post by kingkong »

void wrote: Fri Jul 05, 2024 10:50 pm I will consider a limit-children: search function.

Thank you for the suggestion.



I will also consider a distinct-count: search function.

limit-children:3 would be the same as distinct:path distinct-count:3

limit-children:1 would be the same as distinct:path
distinct:path is already implemented.
I'd like to second this request, I've seen the question pop-up before namely here: https://mail.voidtools.com/forum/viewtopic.php?t=11322 and although it may be an exotic feature it would add some enormous (IMO) power to an already phenomenal list of search functions.

I particularly have a use case for such a function along with the following search query I use:

E.g. `randomize: count:128 ext:wav length:0..3`

This typically works fine across a folder and its contents (sub folders/files) except in the case where one search (as per attached screenshot below) is searching across 10 sub-folders containing a combined 5,472 files. The randomness of the selection is highly uneven favoring those files from folders that I select first over those later.

Image

Of the folders selected, the result set is dominated only by those files from the Kicks, Claps, and Cymbols folders.

A `limit-children:` function would be superb.

E.g. `randomize: count:128 ext:wav length:0..3 limit-children: 10`

It'd also be (I might be pushing one's luck here) awesome to have something similar to `max-limit-children: N` which would behave in an "less than or equal to N" files from children folders in the case where an exact amount is not required i.e. fixed or variable.

For my use case I wrote a separate standalone tool using Electron and NodeJS to accomplish this, though it'd be great to see such capabilities make their way into Everything.

Appreciate the consideration either way and thanks for your continued work.
Post Reply