Request: Number value exactness tolerance and approximation

Discussion related to "Everything" 1.5 Alpha.
Post Reply
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Request: Number value exactness tolerance and approximation

Post by raccoon »

Scenario: You want to search for files that are 2 gigabytes in size.
Syntax: size:2gb

Scenario: You have no files that are exactly 2,147,483,648 bytes in size, but are interested in locating files that are approximately 2 gigabytes.
Syntax: size:1.999gb..2.001gb

Proposed Syntax: size:~2.00gb

In the above proposed syntax, the universally familiar approximation symbol "~" (tilde) is used, followed by a number value that asserts decimal precision for the approximation, and should use centered rounding up and down. Where size:~2gb shows files between 1.5gb and 2.499999gb, and size:~2.0gb shows files between 1.95gb and 2.049999gb, and size:~2.00gb shows files between 1.995gb and 2.004999gb

Alternately, you can tweak this so ~2gb means 2gb +/- 0.5% (1% tolerance) or +/- 0.05% (0.1% tolerance), such that two decimal places of precision are already implied without having to be specified. This would make it work for values that contain no decimal places, such as size:~100mb

size_approximation_tolerance=0.001
size_approximation_always_on=0
void
Developer
Posts: 16897
Joined: Fri Oct 16, 2009 11:31 pm

Re: Request: Number value exactness tolerance and approximation

Post by void »

Everything is already using approximation when no operation is supplied.

Although, the approximation is quirky for size and could be improved.

Currently, Everything is using a ceiling size search to the nearest KB:

size:2gb is the same as: size:2147482625..2147483648
size:=2gb is the same as: size:2147483648
size:==2gb is the same as: size:2147483648



I will experiment in the next alpha with changing this to:

size:2gb is the same as: size:2147483648..3221225471 (>=2gb <3gb)

There was backwards compatibility reason for keeping the old KB ceiling.
The existing KB ceiling search is not very useful, so I'll look into enforcing this change.
Use size:start..end for an exact range (start and end are inclusive)

There's also quirkiness from the fact that we display ceiling of sizes in KB.
It is important for a size:123kb search to match files that display a size of 123KB.
This only really applies when using the kb suffix.



Use a decimal place to increase the precision.
For example:
size:2.0gb (matches >=2.0gb <2.1gb)

(using a decimal place already works as expected)



I will consider a ~ operator.
The current method doesn't give a +/- tolerance, only a + tolerance.
Maybe the number of tilde could define the precision..
Thank you for the suggestions.
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: Request: Number value exactness tolerance and approximation

Post by raccoon »

Thanks. And interesting info about the kB stuff.

I don't know that size:2gb should mean 2gb..3gb, that just feels wrong. Intuitively, it should at least mimic what Microsoft does in Windows Explorer when it says a file is 2gb. I assume that means that it's 2gb +/- 10mb or 90mb or something, only changing to 2.1gb after a certain threshhold of maybe 100 mb. That's where I came up with the tolerance as a percentage (%).

I like that you already have something that can increase precision by adding decimal places, and I'm shocked I hadn't noticed it until now. I would never have expected that loose approximations only turn on when specifying a decimal, so that part wasn't intuitive. But I'm gonna use it for the time being. Thanks!
void
Developer
Posts: 16897
Joined: Fri Oct 16, 2009 11:31 pm

Re: Request: Number value exactness tolerance and approximation

Post by void »

In Windows Explorer:
size:2gb means size:1073741825..2147483648
size:1gb means size:1..1073741824
size:0gb means size:0
(I'm calling this ceiling size search)



They are doing this to match the ceiling size.
Which is odd, because they don't show the ceiling of the size after KB.
So to find a file that is reporting as 200 MB, you'll need to search for size:201MB



I'm making too many special cases for size:
I don't want the size: search to be "smart" like Windows Explorer.
"smart" searches will make it impossible for users to work out what Everything is doing.
Everything will keep things simple and search the floor value.
I would like to keep the value search consistent for all functions.
length:5m will search for files with a duration of 5minutes to 6minutes (exclusive)
total-bit-rate:2mbps will search for files with a duration of 2mbps to 3mbps (exclusive)

size:2mb should do the same: 2mb to 3mb (exclusive)
size:2gb should do the same: 2gb to 3gb (exclusive)

The suffix should determine the precision.
Use size:2.0gb to match 2.0gb to 2.1gb (exclusive)
Use size:2.00gb to match 2.00gb to 2.01gb (exclusive)
Use size:2048mb to match 2048mb to 2049mb (exclusive)


I'll consider leaving the KB quirkiness because Everything displays the ceiling size value.
size:2kb will break this standard in Everything and search for:
size:1025..2048
instead of:
size:2048..3071

I'm tempted to use the floor values for kb and have no special cases.
The floored size value is shown in the statusbar for the selected item.

I'll add some options here so users can customize it to their liking.
therube
Posts: 5003
Joined: Thu Sep 03, 2009 6:48 pm

Re: Request: Number value exactness tolerance and approximation

Post by therube »

I will experiment in the next alpha with changing this to:
size:2gb is the same as: size:2147483648..3221225471 (>=2gb <3gb)
That would not be apparent at all (& confusing, I would think).
void
Developer
Posts: 16897
Joined: Fri Oct 16, 2009 11:31 pm

Re: Request: Number value exactness tolerance and approximation

Post by void »

Everything 1.5.0.1336a make some changes to size searching:

size: will now search the floored size with the specified precision (kb/mb/gb).

For example:
size:2gb will match files with a size of: 2147483648-3221225471 bytes. (2gb - 3gb)
size:2.0gb will match files with a size of: 2147483648-2254857830 bytes. (2.0gb - 2.1gb)
size:2.00gb will match files with a size of: 2147483648-2158221066 bytes. (2.00gb - 2.01gb)
size:2048mb will match files with a size of: 2147483648-2148532223 bytes. (2048mb - 2049mb)
size:=2gb will match files with a size of: 2147483648 bytes. (exactly equal)
size:==2gb will match files with a size of: 2147483648 bytes. (exactly equal)

Previously, size:2gb would match 2097152KB - 2097153KB
(which is not very useful)



If you want to match the ceiling size like Windows Explorer:
  • Copy and paste the following into your Everything search box:
    /size_ceil_search=1
  • Press ENTER in your Everything search box.
  • If successful, size_ceil_search=1 is shown in the status bar for a few seconds.
Post Reply