Smart Folder: Search for documents
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2017 08:30 AM
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.
- Labels:
-
Alfresco Content Services
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2017 09:38 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2017 10:55 AM
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"
}
}
]
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2017 11:28 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2017 03:15 AM
Hi Cesar,
I tried what you suggested, and I got just the one result: docLib (image, and not pdf) file.
Regards,
-nader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2017 03:32 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2017 11:35 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2017 10:35 PM
