You are viewing limited content. For full access, please sign in.

Question

Question

Search for empty folders - syntax

asked on August 11, 2014

I was wondering if this is the correct syntax to search for all empty folders and empty subfolders:

 

{LF:Name="*", Type="F"} - {LF:ChildName="*"}

 

I am not able to use workflows so my only way is through advanced search.

 

Thank you.

0 0

Replies

replied on August 11, 2014 Show version history

Hey Andrea,

 

It looks like this question has already been answered!  Remember to do a quick search using the search bar in the top right to make sure that your question hasn't been previously asked before posting!

 

https://answers.laserfiche.com/questions/48996/how-to-search-repository-and-only-return-empty-folders

0 0
replied on August 11, 2014

Yes, I did see that Rob, but I just wanted to be sure that it is not just finding subfolders that are empty, but both the parent and child folders that are.

0 0
replied on August 11, 2014

Awesome!  I suggest that you go an check to see if the search results are in line with what you were expecting!  I just tested this out on my side and found some interesting results, so if this search syntax doesn't return what you're expecting, just let me know where the results don't align with what you were expecting and we'll see what other options are available, if necessary.

0 0
replied on August 11, 2014

I am getting the correct results, but it takes a very long time. I applied the search on 6 folders. One of the folders was empty and I created another empty folder with 2 empty subfolders. It took 2 hours to finish.

0 0
replied on August 11, 2014

Hmmm that doesn't seem very useful.  The search being run is certainly resource intensive, but not to the point where it should take 2 hours.

 

When you say that you applied the search on 6 folders, do you mean that there are only 6 folders in the entire repository, or only 6 folders at the root level?  No matter the circumstances, of course 2 hours is far too long; I'm just looking for additional information to help me troubleshoot.

 

Can you confirm that other searches run in a more reasonable amount of time?

0 0
replied on August 12, 2014

The repository is huge. I created the 6 folders as test folders, I beleieve at the root level.

 

Department - > Clerk - > Testing - > Then the 6 folders

 

It is only when I use advaced search do I see it taking well beyond the average time (25 minutes max) for any of the other searches.

0 0
replied on August 12, 2014

Just finished re-running the test, but this time with 59 parent folders and multiple subfodlers within. The search did not generate empty folders. Back to square one.

0 0
replied on August 12, 2014

I think it's time to take a step back and figure out exactly what's happening here.

 

1) Why do you need to run this search?  Is this a one time thing to clean up the repository or will this search be run regularly?

2) Why can you not use Workflow?

3) It sounded like you tested the search and it returned results in line with what you were expecting originally.  Using the same syntax with more folders changed the logic of the search?

 

0 0
replied on August 12, 2014

Thank you so much for all your help Rob!

 

1) Clean up the repository - I plan to refine my "empty folders" results by date as well.

 

2) There is only one person in my organization that has access to workflows. They do not plan to allow anyone else...

 

3) Yes, not sure why it changed with the addition of more folders.

 

1 0
replied on August 12, 2014 Show version history

I can think of two possible reasons why the results did not match your expectations:

 

1) If you are looking to return only folders that do not have any contents (no documents, folders, or shortcuts), you need to specify the type for LF:ChildName,  since ChildName defaults to only documents. This means that folders which contain no documents but do contain subfolders would be returned from your search.

 

To return folders with no contents:

{LF:Name="*", Type="F"} - {LF:ChildName="*", Type="DFS"}

2) Some security settings may interfere with the results. I was seeing folder that had contents be returned when I only had browse rights to those folders.

 

0 0
replied on August 12, 2014

I'll run this now and see what I get.

 

Thank you Brianna!

1 0
replied on August 12, 2014

To add to Brianna's points, you might want to try modifying the security for the user who's running the search.  In particular, you'll want to give that user the Bypass Browse right in the Admin Console.  

 

The reason I expect this to help is because when running searches, the search logic must remember to not return entries that the user doesn't have access to.  This "security evaluation" increases the resources necessary to run the search, and in turn, will make the search take longer.  Searching with a user who has Bypass Browse will remove the need for the Client to evaluate security, and should yield faster results.

 

I'm wondering if we can get more predictable results when specifying the "Type" as Brianna pointed out above.  In case you're wondering, D, F, and S, in the syntax above are representing Documents, Folders, and Shortcuts (the three entry types in Laserfiche).  I'm not positive how specifying the entry type in the search affects the time required to run, but hopefully when combined with the Bypass Browse we can get more reasonable search times.

1 0
replied on August 13, 2014

Brianna, I get an error when I use the syntax you posted above. I am running it once more and I will post my findings.

0 0
replied on August 13, 2014

What specifically is the error you get? When I copy and paste the syntax I posted and run the search, I do not have any issues.

0 0
replied on August 13, 2014

0 0
replied on August 13, 2014

General speaking, "Entry not found" is not something that is returned from the search engine: what version of Client are you using??

 

There was a bug in 8.2 that caused "Entry not found" to be returned instead of the message "The current request could not be performed because there are too many existing operations running". If you have too many search windows, you will be unable to perform additional searches.

 

If you are using 8.3 or later: did you get the error after you clicked on one of the documents? Are you just performing an advanced search from within the search pane, or are you using an integration?

0 0
replied on August 13, 2014

Using 8.2. It was the only search I was running and it was on the orignal 6 folders I talked about earlier in my posting.

0 0
replied on August 11, 2014

It depends on whether "empty" means "has no documents" or means "has no documents, folders, or shortcuts".

 

LF:ChildName defaults to only searching for documents, so if you use the syntax from your question, any folder that contain subfolder or shortcuts but no documents will still be returned.

 

To return only folder that have no contents at all, you would want the following syntax:

{LF:Name="*", Type="F"} - {LF:ChildName="*", Type="DFS"}

Where I have added Type="DFS" so that ChildName includes Documents, Folders, and Shortcuts.

You are not allowed to follow up in this post.

Sign in to reply to this post.