not getting totalItems when running cmis query

cancel
Showing results for 
Search instead for 
Did you mean: 
archiver
Member II

not getting totalItems when running cmis query

Hi,

I am trying to use cmis queries to implement pagination in my php script. However I'm facing strange behaviors from Alfresco results sets.

When I run the following query:

{
"query":{

"query":"select * from adb:sampledoc where IN_TREE('46518183-593c-481f-b30e-4a42baeb07ff') ORDER BY cmis:creationDate DESC",
"language":"cmis"
}
}

I get the following result set:

{
"list": {
"pagination": {
"count": 0,
"hasMoreItems": false,
"totalItems": 0,
"skipCount": 0,
"maxItems": 100
},
"entries": []
}
}

which contains totalItems, that I need for pagination.

However, when I run the following query:

{
"query":{

"query":"select * from adb:sampledoc where IN_FOLDER('bb5715ed-38b1-4b01-839a-6064dfd10f82') ORDER BY cmis:creationDate DESC",
"language":"cmis"
}
}

I get the following result set:

{
"list": {
"pagination": {
"count": 100,
"hasMoreItems": true,
"skipCount": 0,
"maxItems": 100
},
"entries": [...]
}
}

As you see, the totalItems is missing. Does anybody know if this is a bug or I'm doing something wrong

Even stranger is that, we have alfresco on other systems. running the query with IN_FOLDER gives totalItems back.

Any help is appreciated.

Thanks

1 Reply
cesarista
Customer

Re: not getting totalItems when running cmis query

Hi:

IN_TREE is not supported in CMIS queries solved by database (transactional metadata queries), so maybe your differences between your systems is how they configure the search subsystem (if your query is solved by database when possible or if it is always sent to SOLR). I can not confirm it but I would say that SOLR should give you totalItems.

Regards.

--C.