cancel
Showing results for 
Search instead for 
Did you mean: 

Lucene search to search only specific folders under multiple

shikarishambu
Champ in-the-making
Champ in-the-making
I have a folder structure that  is as follows
- Root
   - Department Home 1..n
     - WorkingDocs
     - FinalDocs

I want my search to only look at FinalDocs folders but go across all the DepartmentHomes. Is there a way to do this?

TIA
3 REPLIES 3

openpj
Elite Collaborator
Elite Collaborator
Please, can you explain exactly your requirement?

shikarishambu
Champ in-the-making
Champ in-the-making
As mentioned in my earlier post I have folders for each department under Company_Home. Each of these department folders have two folders under them Drafts and Final.

I want to be able to search from the root (Comapny_Home), all Final doc folders under all Departments (not Drafts)

If I do "/" I will get all folders underneath, and I do not want that.

invictus9
Champ in-the-making
Champ in-the-making
One way to approach this is let your security model work for you. If you make Drafts in each Department Home readable only by individuals within that department that are working on those drafts, then doing a search of all documents will only return ones that you have permission to read. If you belong to that department, then you might get the Drafts contents as well.

Another approach is to create an aspect intended for published documents – this is a good idea anyway. The aspect might include publication date, expiration date, and status. The status of DRAFT would indicate that it is not available for general searching, or PUBLISHED would indicate that it is. Then, extend your Lucene search with a check for having this aspect, and the aspect status having the required value.