The pipe operator (|) does not work as expected in search

Discussion related to "Everything" 1.5 Alpha.
Post Reply
Raindrops
Posts: 247
Joined: Sat Jan 21, 2023 10:04 am

The pipe operator (|) does not work as expected in search

Post by Raindrops »

If I enter pdf|epub in the search, I can see all pdf and epub files.
But if I add any additional word, I cannot see any results.

For example, I tried the following searches:
pdf|epub stakeholder
stakeholder pdf|epub

(I changed the order of the search terms to see if that has any effect.)

In both cases, Everything does not show results; although I have many files that meet this search criteria.
In other words, Everything can match the given term in the base file name, or in the extension; but not both.

Worse, I tried to search for-
stakeholder|game
Here, Everything shows me only those files where BOTH these terms occur.
In other words, the pipe (|) operator is treated as AND, and not as OR.
void
Developer
Posts: 16745
Joined: Fri Oct 16, 2009 11:31 pm

Re: The pipe operator (|) does not work as expected in search

Post by void »

Please change Tools -> Options -> Advanced -> ignore_punctuation_type to Filename Only.

Does the issue persist?

ignore_punctuation_type=Filename and search will allow operators in the next alpha update.
Raindrops
Posts: 247
Joined: Sat Jan 21, 2023 10:04 am

Re: The pipe operator (|) does not work as expected in search

Post by Raindrops »

I changed the setting, and the problem got resolved completely.

For example, I can search like this:

pdf|epub stakeholder|game

Both pipes work correctly.
  • This shows me files that have either of these terms.
  • All files having pdf and epub extensions are listed.
Thanks!

That said, I have really not understood how this control worked.
Was Everything trying to find the pipe symbol literally?
Is that because Everything cannot handle operators?

Then what about other elements of the search syntax, such as " "?
Were they also treated as literal characters?

For example, if I want to search for a phrase "stakeholder value", (but not where these words appear in the file name in any other order).
void
Developer
Posts: 16745
Joined: Fri Oct 16, 2009 11:31 pm

Re: The pipe operator (|) does not work as expected in search

Post by void »

ignore_punctuation_type="Filename and Search" is currently converting | to a space.

All punctuation (including ") is converted to a space when using ignore_punctuation_type="Filename and Search".

The next alpha update will only remove punctuation in 'search terms'.
This will allow you to use operators and search functions when ignore_punctuation_type is set "Filename and Search".
therube
Posts: 4977
Joined: Thu Sep 03, 2009 6:48 pm

Re: The pipe operator (|) does not work as expected in search

Post by therube »

I take it that
Options | General | Search -> Operator precedence (OR > AND)
will have a bearing here.
(I wonder if I should have used pipes, above? I hope that comes out correctly ;-).)

I also take it that ignore_punctuation_type;Filename Only is the default value?


Myself, I'd much prefer OR > AND & Grouping,
<pdf|epub> | <stakeholder|game>
.
(There's that darn pipe again! I hope I got that correct.)
Raindrops
Posts: 247
Joined: Sat Jan 21, 2023 10:04 am

Re: The pipe operator (|) does not work as expected in search

Post by Raindrops »

@rube
<pdf|epub> | <stakeholder|game>
This construct does not yield the result I want!
It will list all the pdf and epub files, regardless of whether they have either stakeholder or game in their name!

I want that either stakeholder or game must be in the file name; and the extension must be either pdf or epub (no other extension).
therube
Posts: 4977
Joined: Thu Sep 03, 2009 6:48 pm

Re: The pipe operator (|) does not work as expected in search

Post by therube »

Right.
But that depends on the OR/AND operator precedence setting (cause that then affects how the items are grouped).
I take it that
Options | General | Search -> Operator precedence (OR > AND)
will have a bearing here.
Post Reply