Hi,
This is just a minor issue, but grouping multiple extensions using ext:ext1;ext2 differs from the common way of grouping <file1|file2>
Imo, to retain consistency, the ext handler should support the common way as well..
Br,
Avi
Edit: Sorry, Please move to suggestions
Inconsistant syntax between ext and common grouping
-
aviasd
- Posts: 135
- Joined: Sat Oct 07, 2017 2:18 am
Inconsistant syntax between ext and common grouping
Last edited by NotNull on Fri Jun 05, 2020 3:37 pm, edited 1 time in total.
Reason: Moved to Suggestion orum
Reason: Moved to Suggestion orum
-
NotNull
- Posts: 5961
- Joined: Wed May 24, 2017 9:22 pm
Re: Inconsistant syntax between ext and common grouping
See also: viewtopic.php?f=4&t=8933
My personal opinion:
Use ";" for functions [1] to separate a range of parameters and use "|" only as a logical operator.
Some functions only take 1 parameter, so there the | operator should be used:
dm:yesterday | dm:tomorrow
You want to avoid situations like this one: ext:ext1|file1. Should that search for:
files with extension ext1 OR with extension file1?
- or-
files with extension ext1 OR search for files named file1?
[1] And maybe add "," so you could also use ext:ext1,ext2
My personal opinion:
Use ";" for functions [1] to separate a range of parameters and use "|" only as a logical operator.
Some functions only take 1 parameter, so there the | operator should be used:
dm:yesterday | dm:tomorrow
You want to avoid situations like this one: ext:ext1|file1. Should that search for:
files with extension ext1 OR with extension file1?
- or-
files with extension ext1 OR search for files named file1?
[1] And maybe add "," so you could also use ext:ext1,ext2
-
void
- Developer
- Posts: 19903
- Joined: Fri Oct 16, 2009 11:31 pm
Re: Inconsistant syntax between ext and common grouping
Thanks for the suggestion.
Currently Everything uses a mixture of syntaxes for lists.
In future releases, most Everything search functions that take a list will eat the |
The planned search syntax for lists is:
<string> ::= <any non whitespace character or double quote>* | " <non double quote character>* "
<literal |> ::= <a literal pipe character>
<delimiter> ::= ; | <literal |>
<list> ::= <string> | <list><delimiter><string>
function:<list>
This will be consistent for all search functions that take a list as a parameter.
To use the OR operator, you would need to use a space to break the current search term, for example:
ext:ext1 | file1
The plan is to reserve < and > in functions for sub expressions, for example:
content:<foo bar>
is the same as:
content:foo content:bar
Currently Everything uses a mixture of syntaxes for lists.
In future releases, most Everything search functions that take a list will eat the |
The planned search syntax for lists is:
<string> ::= <any non whitespace character or double quote>* | " <non double quote character>* "
<literal |> ::= <a literal pipe character>
<delimiter> ::= ; | <literal |>
<list> ::= <string> | <list><delimiter><string>
function:<list>
This will be consistent for all search functions that take a list as a parameter.
To use the OR operator, you would need to use a space to break the current search term, for example:
ext:ext1 | file1
The plan is to reserve < and > in functions for sub expressions, for example:
content:<foo bar>
is the same as:
content:foo content:bar
-
aviasd
- Posts: 135
- Joined: Sat Oct 07, 2017 2:18 am
Re: Inconsistant syntax between ext and common grouping
So in this case there will be two OR delimiters: ; and | ?void wrote: Sat Jun 06, 2020 12:53 am
<string> ::= <any non whitespace character or double quote>* | " <non double quote character>* "
<literal |> ::= <a literal pipe character>
<delimiter> ::= ; | <literal |>
I'm not sure i understand this one - how would a list be enclosed ? inside < and > ? does this definition allows creating lists within lists ?<list> ::= <string> | <list><delimiter><string>
I think using | for OR is the common practice in most programming language, and I think only Ms implemented the ; as an OR delimiter for file extensions..
But if in the above case, both will be supported, It's a good solution.
Expressing what you need everything to find in the quickest way was always one of it's strength and searching in it always feels very natural to use, w/o thinking too much about syntax, so the more ways for express-abiliy the better
I'm guessing that Inside the sub expressions the OR delimiter could be used ? e.g content:<foo|bar>The plan is to reserve < and > in functions for sub expressions, for example:
content:<foo bar>
is the same as:
content:foo content:bar
-
void
- Developer
- Posts: 19903
- Joined: Fri Oct 16, 2009 11:31 pm
Re: Inconsistant syntax between ext and common grouping
Yes, two delimiters will be supported.So in this case there will be two OR delimiters: ; and | ?
; can be escaped with double quotes.
doubles quotes can be escaped with quot: (or ": in future versions of Everything)
| can be escaped with &verbar: in future versions of Everything.
The list does not need to be enclosed.I'm not sure i understand this one - how would a list be enclosed ? inside < and > ? does this definition allows creating lists within lists ?
A whitespace will break the search term.
lists cannot contain more lists.
think of the list syntax as:
<string><delimiter><string><delimiter><string><delimiter><string>...
list functions do not need to support sub-expressions.
I will consider adding support for < and > to enclose lists.
whitespaces inside < and > would most likely be treated as literal.
Correct.I'm guessing that Inside the sub expressions the OR delimiter could be used ? e.g content:<foo|bar>
subexpressions will support:
whitespace = AND
| = OR
! = NOT
Everything 1.4 syntax:
ext:jpg;png;gif
filelist:"new text document.txt|new text document (2).txt"
Future syntax:
ext:jpg;png;gif
ext:jpg|png|gif
filelist:"new text document.txt";"new text document (2).txt"
filelist:"new text document.txt"|"new text document (2).txt"
filelist:"new text document.txt|new text document (2).txt"
possibly: filelist:<new text document.txt|new text document (2).txt>
-
aviasd
- Posts: 135
- Joined: Sat Oct 07, 2017 2:18 am
Re: Inconsistant syntax between ext and common grouping
I see . I'm guessing you have your reasons of not escaping with the standard backslash \void wrote: Mon Jun 08, 2020 12:26 am
Yes, two delimiters will be supported.
; can be escaped with double quotes.
doubles quotes can be escaped with quot: (or ": in future versions of Everything)
| can be escaped with &verbar: in future versions of Everything.
I'm sorry if I'm being difficult here but you say that whitespaces inside sub expressions would be treated as literal as well as being an AND delimiter.
whitespaces inside < and > would most likely be treated as literal.
Correct.I'm guessing that Inside the sub expressions the OR delimiter could be used ? e.g content:<foo|bar>
subexpressions will support:
whitespace = AND
| = OR
! = NOT
So which one is the correct one ?
I think what you expressed in the first post will likely be the better option - an AND expression
for example:
now to find a folder that has both invoice and work. I need to specify two search terms:
Code: Select all
parent:invoice parent:work
Code: Select all
parent:<invoice work>
I do think that whitespace as an AND delimiter inside sub expressions can create a bit of ambiguity and suggest you would consider an explicit delimiter for AND. (Maybe & ? )
Somthin like
Code: Select all
parent:<invoice&work>Code: Select all
parent:invoice&workThis makes it very clearEverything 1.4 syntax:
ext:jpg;png;gif
filelist:"new text document.txt"|"new text document (2).txt"
filelist:"new text document.txt|new text document (2).txt"
Future syntax:
ext:jpg;png;gif
ext:jpg|png|gif
filelist:"new text document.txt";"new text document (2).txt"
filelist:"new text document.txt"|"new text document (2).txt"
filelist:"new text document.txt|new text document (2).txt"
possibly: filelist:<new text document.txt|new text document (2).txt>
P.S - Thanks for the detailed response !