Smart Folder: Search for documents

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Active Member

Smart Folder: Search for documents

I'm trying to define a 'smart folder template' to search for documents, but it doesn't work as expected. My target objective is to search documents by their properties, but I started with very simple criteria to retrieve/hit all documents. Here is my folder structure

Folder-1

- folder-11 (containing pdf files)

- folder-12 (containing pdf files)

..

- search-folder: (smart-folder)

Here is the content of my JSON file: 

{
  "name": "Zoek Betaald Facturen",
  "nodes": [{
       "id": "1",
       "name": "PDF Documents",
       "search": {
       "language": "fts-alfresco",
       "query": "=cm:content.mimetype:application/pdf"
     }
  }
]
}

The template finds only one file: docLib, that comes with Alfresco, and its type is image/png. I've also tried to use some of the search criteria from 'smartFolderExample.json' file with the same result. I appreciate any help to resolve the issue.

7 Replies
Highlighted
Established Member II

Re: Smart Folder: Search for documents

Hi,

You forgot for PATH parameter.

Hence your query will, e.g.:

"query": "(PATH:'/app:company_home/st:sites/cm:site-name/cm:documentLibrary//*') AND‍ =cm:content.mimetype:application/pdf"

PATH is mandatory parameter.

Smart Folder Template syntax | Alfresco Documentation 

Highlighted
Active Member

Re: Smart Folder: Search for documents

Bayu Widyasanyata‌,

thanks for your reply. I added the path as well. I don't get any hit. Here is my JSON content now:

{
"name": "Zoek Betaald Facturen",
"nodes": [{
"id": "1",
"name": "PDF Documents",
"search": {
"language": "fts-alfresco",
"query": "(PATH:'/app:company_home/st:sites/cm:HBS/cm:documentLibrary//*') AND =cm:content.mimetype:application/pdf"
}
}
]
}

Highlighted
Customer

Re: Smart Folder: Search for documents

Hi:

Just delete the parenthesis, and try the query again. You must have PDF files in your site.

If nothing appears, may you copy your query directly in Alfresco search ? In that case, do you have any results ?

If nothing appears, you may have some problem with your indices. Try to do searches in this site to check if SOLR is giving you any results.

Regards.

--C.

Highlighted
Advanced II

Re: Smart Folder: Search for documents

The path parameter that is required is not the one inside the query itself.

The query can be anything, without the need to include the path, as the Smart Folder can show objects from anywhere in the repository.

The required path parameter is used just when you are using the filing feature. See:

Mandatory property in a filing rule. Path to store new documents. This is the ISO9075 encoded QName.

More on the filing, from the same page:

Optional rule that defines the filing action for a new file when it is uploaded to the Smart Folder. If no filing rule is defined, files are not permitted to be uploaded to that folder. Parameters include:
        path: path where a document is physically stored
        classification: type and aspects assigned to the new file
        properties: property values attributed to the new file

Highlighted
Established Member II

Re: Smart Folder: Search for documents

Thanks ‌ for your clearer explanation. Yes, the path is not a mandatory. I revised my answer above.

Highlighted
Active Member

Re: Smart Folder: Search for documents

Hi Cesar,

I tried what you suggested, and I got just the one result:  docLib (image, and not pdf) file. 

Regards,

-nader

Highlighted
Customer

Re: Smart Folder: Search for documents

Hi:

If you are doing the correct search in a site with pdf files inside, and no values (and same results) are obtained both in Alfresco search field or Smart folder, you may check your SOLR indices and reindex if possible. You should see SOLR related errors in your solr.log or catalina.out, if it is the case.

This recipe may help:

- Performing a full reindex with Solr for Alfresco ECM - zylk 

Regards.

--C.