Restrict specific search to the top folder level

Discussion related to "Everything" 1.5 Alpha.
Post Reply
abr01
Posts: 89
Joined: Tue May 01, 2018 4:57 pm

Restrict specific search to the top folder level

Post by abr01 »

Using camera-model:abc after having re-index the database including the camera model property is fun and very fast. But i found, that i would need to limit the search path to the first level. So everything in K:\Bilder\Fotografie\Dated Folders (e.g. K:\Bilder\Fotografie\Feb-12-2024), but excluding all other subfolders, like K:\Bilder\Fotografie\Outtakes, K:\Bilder\Fotografie\Original etc.

I checked the Everything Search Functions, but didn't find anything that looked suitable.

Edit, i found part of the solution by adding commands like !Original !Outtakes etc., but maybe there is a more generic way to include only the top level.
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: Restrict specific search to the top folder level

Post by NotNull »

Code: Select all

regex:"K:\\Bilder\\Fotografie\\[a-z]+-\d\d-\d\d\d\d\\"
[a-z]+ = 1 or more characters a-z (including A-Z)
\d\d = 2 digits
\d\d\d\d = 4 digits
\\ = a normal path-backslash.


Alternative:

Code: Select all

wildcards:"T:\\Bilder\\Fotografie\\*-##-####\\**"
# = a number 0-9
* = matches zero or more characters, stops at path separator (=backslash)
* = matches zero or more characters, does not stop at path separator (=backslash)



@void:
Is the \\ as path separator new? Can't remember using this syntax in the past (single backslash instaead)
abr01
Posts: 89
Joined: Tue May 01, 2018 4:57 pm

Re: Restrict specific search to the top folder level

Post by abr01 »

NotNull, none of both codes work here yet.

My full (example) command is

camera-model:XF1 wildcards:"K:\\Bilder\\Fotografie\\*-##-####\\**"

to filter for that camera model and excluding deeper paths.

I also try to build a template, where i have just to fill in my camera model, but that doesn't work either. What i try is to have the filter search string inserted into the search field.

Image
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: Restrict specific search to the top folder level

Post by NotNull »

Just noticed that I skipped a quote in the regex: version. Repaired in the original post.

Let's approach this step-by-step; your filter will come later on.

- Make sure the Everything filter is enabled
- Make sure no other serach modifiers are enabled under MEnu=> Search (like Regular Expressions, Match Case, etc.)
- Try the following searches, one by one. Which one gives results and which ones don't:

Code: Select all

"K:\Bilder\Fotografie\"
"K:\Bilder\Fotografie\Feb-12-2024"
regex:"K:\\Bilder\\Fotografie\\Feb-12-2024\\"
regex:"K:\\Bilder\\Fotografie\\[a-z]+-\d\d-\d\d\d\d\\"
wildcards:"T:\\Bilder\\Fotografie\\*-##-####\\**"
abr01
Posts: 89
Joined: Tue May 01, 2018 4:57 pm

Re: Restrict specific search to the top folder level

Post by abr01 »

NotNull wrote: Tue Mar 12, 2024 10:29 pm Just noticed that I skipped a quote in the regex: version. Repaired in the original post.

Let's approach this step-by-step; your filter will come later on.

- Make sure the Everything filter is enabled
- Make sure no other serach modifiers are enabled under MEnu=> Search (like Regular Expressions, Match Case, etc.)
- Try the following searches, one by one. Which one gives results and which ones don't:

Code: Select all

"K:\Bilder\Fotografie\"
"K:\Bilder\Fotografie\Feb-12-2024"
regex:"K:\\Bilder\\Fotografie\\Feb-12-2024\\"
regex:"K:\\Bilder\\Fotografie\\[a-z]+-\d\d-\d\d\d\d\\"
wildcards:"T:\\Bilder\\Fotografie\\*-##-####\\**"
- Make sure the Everything filter is enabled
I think it is. If that is 'the' Everything filter at the top, followed by 'audio',, 'compressed' etc .
And i have removed all search modifiers for this test (don't know, if i would need them back for my normal search, though).

And sorry, i wasn't really clear about my example. I want to look into ~1,500 folders, so that Feb-12-2024 was only one example. Therefore examples 2 and 3 are not what i wanted explicitely, more something like K:\\Bilder\\Fotografie\\* with * meaning lots of date folders.

Following image shows what i mean. Everything under the 'date' folder is to be searched, leaving out 'LR', 'Outtakes' and 'Orginals', as they would show redundant or unwanted results. Or in other words, all other subfolders.

Image

But following two search strings brought up nothing so far. Note, that i try to search for camera-model, that's why i have prefixed both of your commands with that search string.

camera-model:XF1 regex:"K:\\Bilder\\Fotografie\\[a-z]+-\d\d-\d\d\d\d\\"

camera-model:XF1 wildcards:"K:\\Bilder\\Fotografie\\*-##-####\\**"
abr01
Posts: 89
Joined: Tue May 01, 2018 4:57 pm

Re: Restrict specific search to the top folder level

Post by abr01 »

I have the impression, that [a-z]+-\d\d-\d\d\d\d\\ stands for the date format. But those date formatted folders should not be filtered. All of them should be searched.

Here's another approach to show what i try to achieve: 23-Okt-23 any many similar folders are not to be filtered out. I want to search only the orange files, resp. their EXIF data for the camera-model, leaving out all 'strike through' subfolders. Sorry for having been unclear.



Image
therube
Posts: 4967
Joined: Thu Sep 03, 2009 6:48 pm

Re: Restrict specific search to the top folder level

Post by therube »

The date format you mentioned first is different from what you've shown (so the regex: would be wrong)?
So these dated "files" are actually files, & not "dated" directories?

If you only want files specifically in K:\Bilder\Fotografie\ & no subdirectories, you can use parents: (3, in this case).
K:\Bilder\Fotografie\ parents:3

& you can extend that if need be, so say you were only looking for picture file names beginning with 2025- (I like to look to the future):
K:\Bilder\Fotografie\ parents:3 \2025- pic:
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: Restrict specific search to the top folder level

Post by NotNull »

This might work:

Code: Select all

pic:   "K:\Bilder\Fotografie\*\*" 
If not, take take a second (or 100!) to formulate way more precise what pattern describes your files/folders as this turns out to be completely different from what you initially asked for.


P.S. You didn't answer my questions ..
abr01
Posts: 89
Joined: Tue May 01, 2018 4:57 pm

Re: Restrict specific search to the top folder level

Post by abr01 »

therube wrote: Wed Mar 13, 2024 3:05 pm The date format you mentioned first is different from what you've shown (so the regex: would be wrong)?
So these dated "files" are actually files, & not "dated" directories?

If you only want files specifically in K:\Bilder\Fotografie\ & no subdirectories, you can use parents: (3, in this case).
K:\Bilder\Fotografie\ parents:3

& you can extend that if need be, so say you were only looking for picture file names beginning with 2025- (I like to look to the future):
K:\Bilder\Fotografie\ parents:3 \2025- pic:
Sorry that i was unclear about the whole structure. I was talking about dated directories, containing image files, and i wanted to filter for different camera models, which now works with both of your codes. In your code i had to have to insert a blank space before the 3. Thanks a lot!
abr01
Posts: 89
Joined: Tue May 01, 2018 4:57 pm

Re: Restrict specific search to the top folder level

Post by abr01 »

NotNull wrote: Wed Mar 13, 2024 9:48 pm This might work:

Code: Select all

pic:   "K:\Bilder\Fotografie\*\*" 
If not, take take a second (or 100!) to formulate way more precise what pattern describes your files/folders as this turns out to be completely different from what you initially asked for.


P.S. You didn't answer my questions ..
Yes, that is what i was looking for. Thank you! And sorry for not having directly answered your five questions. In the old approach none of them worked, abd i have suspected, that i was too unclears with what i've tried to achieve. So finally the code is very short and compact, and it's good to have that example for future filters i might build. Maybe i will re-index and include more photo specific stuff in the contents like apperture, ISO and focal length. I had searches for those properties, and they were very slow, until i realized, i have to include them in the context setting and build a new index. Anyway, now i have two working search types for an almost instant search for the camera types. :) :idea: :arrow:
Post Reply