10-11-2019 03:12 PM
Hi everyone, I have hundreds of thousands of folders in an Alfresco server and need to get information on them using a Python script.
Here's my code:
cmis_client = CmisClient('http://' + alfresco_remote_host + ':' + alfresco_remote_port + '/alfresco/api/-default-/public/cmis/versions/1.1/atom', alfresco_remote_user, alfresco_remote_password) repo = cmis_client.defaultRepository folders = repo.query("select * from cmis:folder") print (len(folders))
I was getting 1000 results before setting those values in alfresco-global.properties:
I now get 10000 results.
Somebody can help me determine where's that 10000 limit and how to increase it?
Thanks for your help.
10-12-2019 12:20 PM
You should NEVER try to load ALL folders in one operation. Even if you manage to find and remove the limitation that restricts to 10000 results now, you may run into the next "restriction": system resources. Why are you not trying to perform incremental queries or recursively process the folders from the root? If you "only" need to know the number of folders, you should not use CMIS query for this, but rather use Alfresco Public v1 ReST API to issue a SOLR-aimed CMIS / FTS query, requesting at most 1 item, and either using facets or the total count of items in the response (regardless of limit) to get the count from SOLR, without having to expensively load the folders from database for result rendering.
10-13-2019 03:47 PM
Thank you for taking the time to help me.
Can you point me out how to do incremental queries?
By the way, I have hundreds of thousands of folders inside a particular folder. I don't want to just to know the number of folders , I want to get the metadata of files under each of them.
Thanks again.
10-14-2019 04:14 PM
Incremental queries can be done in multiple ways, e.g. using simple pagination (skip count / max items + sort order on results) or using conditions to slice results (e.g. cmis:name from letter A to B, and so forth)
Explore our Alfresco products with the links below. Use labels to filter content by product module.