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.
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.
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.
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)
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.