Search grouping issue with 1354 and earlier

Discussion related to "Everything" 1.5 Alpha.
Post Reply
void
Developer
Posts: 16735
Joined: Fri Oct 16, 2009 11:31 pm

Search grouping issue with 1354 and earlier

Post by void »

Everything 1.5.0.1354 and earlier versions have an issue with search groups following a search modifier with a space.

For example:

file: <a> | b

would incorrectly be treated as:

file:a OR b

The space before the group is ignored.



Everything 1.5.0.1355 fixes this issue.

file: <a> | b

is now correctly treated as:

file: AND (a OR b)
tuska
Posts: 1052
Joined: Thu Jul 13, 2017 9:14 am

Re: Search grouping issue with 1354 and earlier

Post by tuska »

Operator precedence: AND > OR

Code: Select all

file: <a> | b
387 808 items (335 351 files, 52 457 folders) ?

_________________________
'Everything' 1.5.0.1355a (x64)
void
Developer
Posts: 16735
Joined: Fri Oct 16, 2009 11:31 pm

Re: Search grouping issue with 1354 and earlier

Post by void »

'52 457 folders' is the expected result for AND > OR.

file: <a> | b

=>

(file: AND a) OR b
(you should see folders in your results containing 'b')
tuska
Posts: 1052
Joined: Thu Jul 13, 2017 9:14 am

Re: Search grouping issue with 1354 and earlier

Post by tuska »

Mmh, unfortunately I don't understand how to bring into line "file:" with "Operator precedence: AND > OR" with these parameters:
file:, files:, folder:, folders: - Match files or folders only.

Up until now I was assuming that the file: parameter only allowed files to be in the search result - and no folders.

---

In this example, for example, no folders are output.

Operator precedence: OR > AND

Code: Select all

file: <a> | b
335 354 items (335 354 files, 0 folders)
void
Developer
Posts: 16735
Joined: Fri Oct 16, 2009 11:31 pm

Re: Search grouping issue with 1354 and earlier

Post by void »

Please try the following search:

file:<a | b>

=>

file:a OR file:b

The file: modifier is applied to both search terms.



Think of file: in the following case:
file: a | b
the same as:
file:* a | b

=>

(file:* AND a) OR b
(with Operator precedence: AND > OR)



With Operator precedence: OR > AND, there will be no folder results with:

file: <a> | b

=>

file:* AND (a OR b)



Consider using ::file: to match files globally with Operator precedence: AND > OR:

::file: a | b
tuska
Posts: 1052
Joined: Thu Jul 13, 2017 9:14 am

Re: Search grouping issue with 1354 and earlier

Post by tuska »

Thanks.
This is what I get...

Operator precedence: OR > AND
file:<a | b>
335 423 items (335 423 files, 0 folders)
file: a | b
335 423 items (335 423 files, 0 folders)
file:* a | b
335 423 items (335 423 files, 0 folders)

Operator precedence: AND > OR
file:<a | b>
335 423 items (335 423 files, 0 folders)
file: a | b
387 880 items (335 423 files, 52 457 folders)
file:* a | b
387 880 items (335 423 files, 52 457 folders)
::file: a | b
335 422 items (335 422 files, 0 folders)
Last edited by tuska on Fri Aug 18, 2023 12:23 pm, edited 1 time in total.
void
Developer
Posts: 16735
Joined: Fri Oct 16, 2009 11:31 pm

Re: Search grouping issue with 1354 and earlier

Post by void »

These are the expected results.


Operator precedence: AND > OR
file:<a | b>
335 423 items (335 423 files, 0 folders)
The file: search modifier is applied to the < > group.

A space following file: will apply the file: search modifier to an empty term.
An empty term will match all files/folders.


file: a | b
387 880 items (335 423 files, 52 457 folders)
=>

(file: AND a) or b

You'll see files containing 'a' and files/folders containing 'b'


file:* a | b
387 880 items (335 423 files, 52 457 folders)
Exactly the same as above.

=>

(file:* AND a) or b
tuska
Posts: 1052
Joined: Thu Jul 13, 2017 9:14 am

Re: Search grouping issue with 1354 and earlier

Post by tuska »

2void
Thank you very much for the explanations :!:
void wrote: Fri Aug 18, 2023 12:23 pm
Operator precedence: AND > OR
file: a | b
387 880 items (335 423 files, 52 457 folders)
The file: search modifier is applied to the < > group.

A space following file: will apply the file: search modifier to an empty term.
An empty term will match all files/folders.
tuska
Posts: 1052
Joined: Thu Jul 13, 2017 9:14 am

Re: Search grouping issue with 1354 and earlier

Post by tuska »

2void
void wrote: Fri Aug 18, 2023 12:23 pm The file: search modifier is applied to the < > group.

A space following file: will apply the file: search modifier to an empty term.
An empty term will match all files/folders.
In the end, it still remains unclear to me why these rules then only apply to
"Operator precedence: AND > OR" and not also for "Operator precedence: OR > AND".
therube
Posts: 4972
Joined: Thu Sep 03, 2009 6:48 pm

Re: Search grouping issue with 1354 and earlier

Post by therube »

search modifier with a space
I take it name: is not a "search modifier"?


(Man, this one confuses me. I'll have to return to it, at some point.
Anyhow, everyone should be using, or at least 99% of the time ;-).)
void
Developer
Posts: 16735
Joined: Fri Oct 16, 2009 11:31 pm

Re: Search grouping issue with 1354 and earlier

Post by void »

In the end, it still remains unclear to me why these rules then only apply to
"Operator precedence: AND > OR" and not also for "Operator precedence: OR > AND".
The issue only applies to Operator precedence: OR > AND

In 1534 and earlier:

file: <a>

is incorrectly treated as:

file:<a>

instead of:

file: AND <a>

There's no operation used in 1354 and earlier.



Maybe look at it this way:

<a> file:

1534 and earlier will correctly treat this as:

a AND file:


I take it name: is not a "search modifier"?
Only search modifiers can cause the issue.

The issue should be minor.

I ran into the issue when performing this search:

file: <*.lnk column-a:="0"> | <* column-a:="1"> sort:column-a

1354 and earlier treated this as:

((file:*.lnk column-a:="0") OR (* column-a:="1")) AND sort:column-a
(the second group would incorrectly match folders)

1355 will correctly treat this as:

file: AND ((*.lnk column-a:="0") OR (* column-a:="1")) AND sort:column-a
tuska
Posts: 1052
Joined: Thu Jul 13, 2017 9:14 am

Re: Search grouping issue with 1354 and earlier

Post by tuska »

2void
void wrote: Fri Aug 18, 2023 11:25 pm The issue only applies to Operator precedence: OR > AND
Thank you for your patience and complementary explanations!
Post Reply