cancel
Showing results for 
Search instead for 
Did you mean: 

10000 results limit problem when using a CMIS query

sbonami
Champ on-the-rise
Champ on-the-rise

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:

  • system.acl.maxPermissionChecks=1000000
  • system.acl.maxPermissionCheckTimeMillis=1000000

I now get 10000 results.

Somebody can help me determine where's that 10000 limit and how to increase it?

Thanks for your help.

3 REPLIES 3

afaust
Legendary Innovator
Legendary Innovator

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.

sbonami
Champ on-the-rise
Champ on-the-rise

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.

afaust
Legendary Innovator
Legendary Innovator

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)