Hello everyone,
We've came across a pagination problem since we've upgrade Alfresco to v7.2.1.
I'm using the Search API with this body:
{ "query": { "language": "cmis", "query": "select * from cmis:document where in_folder('fc896c39-b13b-493a-bdeb-9152d8495dd0')" }, "fields": ["id"], "paging": { "maxItems": 1, "skipCount": 0 } }
I have 3 files in this directory and the pagination results are wrong, here is the response :
{
"list": {
"pagination": {
"count": 1,
"hasMoreItems": true,
"totalItems": 2,
"skipCount": 0,
"maxItems": 1 }, "entries": [
{ "entry": {
"id": "7149284e-7422-4f55-b16e-63a8cd61fa76" } } ] } }
The fields totalItems says 2 but i have 3 files.
Does somebody ever came across this behavior ?
Thanks.
Could you check same query in alfresco node browser and check result?
Thank you for your reply.
I tried the cmis request on the node explorer and the results and pagination seems correct (3 results).
But the problem i have is with the pagination infos, the number of items are correct bu not the pagination info (totalItems).
It happens when i set the field "maxItems" to 1 and "skipCount" to 0 (i want only one file in the response but with pagination info).
The cmis query i'm using is mainly for retrieving the number of files in a directory, that's why i want only one file, because i'm only interested in the pagination results to have the field totalItems.
I've also tried the API /nodes/{nodeId}/children, the pagination info is correct, so is it a problem with the search api ?
I'm still looking for help.
Why not using a lucene/AFTS query with PARENT:"yourparentnode" ??
Also, maybe is it possible that your third node is not a cmis:document ?
Hi, thanks for your reply.
We can't use AFTS because our project is developed around CMIS. But i can try just for debugging
Yes my third node is a cmis:document
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.