10000 results limit problem when using a CMIS query

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

10000 results limit problem when using a CMIS query

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
afaust
Master

Re: 10000 results limit problem when using a CMIS query

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
Active Member

Re: 10000 results limit problem when using a CMIS query

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.

Highlighted
afaust
Master

Re: 10000 results limit problem when using a CMIS query

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)