column value based on result count, filter values, and highlight words?

Discussion related to "Everything" 1.5.
bigheadghost
Posts: 9
Joined: Tue Aug 15, 2017 2:31 am

column value based on result count, filter values, and highlight words?

Post by bigheadghost »

add column A, let's say, use $name for example to get some value.

Code: Select all

d:\test\*.txt addcol:a  a:=$name:  
question1:
set value $name when result count<10 (which means less than 10 txt files in the folder), set value "" otherwise
reason: When the search filter is loose, lots of results are returned. There is no need to calculate column A.
When more search words are typed in, restriction gets tight. Results are narrowed down. It's time to calculate column A. And it's time to filter them further as shown in question2.

question2:
filter result based on column A. like a:xxx to return items with xxx in column A.
xxx can have two or more words, logical support is better: (a OR b), (a AND b)

question3:
highlight string xxx in column A. logical support is better.
void
Developer
Posts: 20041
Joined: Fri Oct 16, 2009 11:31 pm

Re: column value based on result count, filter values, and highlight words?

Post by void »

set value $name when result count<10 (which means less than 10 txt files in the folder), set value "" otherwise
Not possible.
Support for this might be added in a future version with a GET_DIRECTORY_LISTING() function that returns an array of items.

It can be done with multiple passes:
Search for: d:\test\*.txt
Export results to a temporarily file list (File -> Export -> EFU Everything File List)
Open the file list (File -> Open File List)

Use $sibling-file-count: as the number of txt files in the folder.
Search for:
d:\test\*.txt addcol:a a:=$siblingfilecount:<10?$name::""



question2:
filter result based on column A. like a:xxx to return items with xxx in column A.
xxx can have two or more words, logical support is better: (a OR b), (a AND b)
Cannot be done with a:
However, can be done with column-a:
For example:
column-a:xxx



question3:
highlight string xxx in column A. logical support is better.
string xxx will be highlighted when using
column-a:xxx
bigheadghost
Posts: 9
Joined: Tue Aug 15, 2017 2:31 am

Re: column value based on result count, filter values, and highlight words?

Post by bigheadghost »

the example
d:\test\*.txt
above might have been misleading.
It is not about the number of files in the same specific folder, but the number of returned result items.

senario steps:
  1. you typed
    d
    in the searchbox, millions of items returned in the result listbox. There's no need to do the calculations of column A for every item in the result, especially when it's time-consuming like hash etc. Just return
    emtpy/nothing/""/"waiting"/placeholders/etc.
  2. then you typed
    :
    , i.e. the search text became
    d:
    . Items returned got less, like thousands. Still no calculations.
  3. keep typing, when the search text became
    d:\test\ *.txt
    , 3 items returned. Now it's time to do the calculations.
another example:
*.txt
returned millions of items, no calculation of column A.
while
*.txt size:>100m
returned 2 items, calclulate.

----

btw, why does
d:\test\ *.txt addcol:a a:=$siblingcount:
return:
  • Name columnA path
  • 1.txt 1 d:\test
  • 1.txt 1 d:\test\a
  • 2.txt 2 d:\test\a
d:\test\
has one file
1.txt
and one folder
a

d:\test\a\
has two files
1.txt
and
2.txt

Shouldn't the columnA value of
d:\test\a\2.txt
be 1? siblingfilecount (0,1,1) and siblingfoldercount (1,0,0) is correct.
void
Developer
Posts: 20041
Joined: Fri Oct 16, 2009 11:31 pm

Re: column value based on result count, filter values, and highlight words?

Post by void »

The values for Column A are only calculated when shown or when required by a search or sort.

The following search:
d add-column:a a:=$name:


will be instant.
Only the visible items will gather values for Column A.
(not all files/folders containing d)



btw, why does d:\test\ *.txt addcol:a a:=$siblingcount: return:
I see the expected results.
They should all be 1.
sibling-count is cached by Column A.
The sibling count may have changed.
Please press F5 to update Column A cache.



Slightly off topic, but if you wanted to limit the number of items to 10 from each folder, include the following in your search:
dupe-min:1 dupe-max:10 dupe:path
bigheadghost
Posts: 9
Joined: Tue Aug 15, 2017 2:31 am

Re: column value based on result count, filter values, and highlight words?

Post by bigheadghost »

cool!
The values for Column A are only calculated when shown or when required by a search or sort.
And yes, for cases like:
d file: size:>1g addcol:a a:=$md5:
and
d file: size:<1k addcol:a a:=$md5: sort:a

Unnecessary computations and disk accesses are still wasted: dozens of items shown in the former, and millions in the latter.

Well, property indexing or turning off "search as you type" is a workaround. It would be neat to have something like
a:=$result-items-count:<10?$name::""
as $sibling-file-count.