Page 1 of 1

How to perform this search in ES Cli?

Posted: Fri Mar 15, 2024 10:33 pm
by Ralf_Reddings
Searching
"C:\dog run"|"C:\cat run"
on a Everything 1.5 window correctly finds all of the items in directories
dog run
and
cat run
:

Code: Select all

C:\cat run\
C:\dog run\
C:\cat run\cats 1.png
C:\cat run\cats 2.png
C:\cat run\cats 3.png
C:\dog run\dogs 1.png
C:\dog run\dogs 2.png
C:\dog run\dogs 3.png
I am attempting to perform the same search on ES cli. Due to how the search string must not be quoted in ES cli, its very difficult to figure out a working method.

Code: Select all

ES '<"C:\dog run"|"C:\cat run">'       #Nothing gets returned for this search
ES "<"C:\dog run"|"C:\cat run">"       #This search returns just the parent folders. No child items
#C:\cat run
#C:\dog run
ES ""C:\dog run""`|""C:\cat run""      #Same as above, returns only parent folders, no children

ES "C:\dog run""`|""C:\cat run"        #Returns only the child items for "dog run" but not the "dog run" directory. "Cat run" is entirely ignored
#C:\dog run\dogs 1.png
#:\dog run\dogs 2.png
#:\dog run\dogs 3.png
I have tried alot of other variations but nothing works. If anyone has a working method particularly for PowerShell, I would appreciate it.

Re: How to perform this search in ES Cli?

Posted: Fri Mar 15, 2024 11:38 pm
by void
Please try the following Powershell call:

es "C:\dog run" `| "C:\cat run"

Re: How to perform this search in ES Cli?

Posted: Sat Mar 16, 2024 10:34 am
by Ralf_Reddings
It works!
Cheers!

Re: How to perform this search in ES Cli?

Posted: Mon Mar 18, 2024 2:55 pm
by therube
Is that backtick (`) meant to be there?

Re: How to perform this search in ES Cli?

Posted: Mon Mar 18, 2024 10:15 pm
by void
Yes.
Otherwise, | is treated as a pipe.

Spaces around `| are also required.
Otherwise, "1"`|"2" is treated as: 1 |2
(| and 2 are combined)