I have a question about the good way to use pagination with Alfresco. I know the documentation (https://wiki.alfresco.com/wiki/4.0_JavaScript_API#Search_API) and I use with success the query part. I mean by that that I use the parameters maxItems and skipCount and they work the way I want. This is an example of a query that I am doing :
var paging =
{
maxItems: 100,
skipCount: 0
};
var def =
{
query: "cm:name:test*"
page: paging
};
var results = search.query(def);
The problem is that, if I get the number of results I want (100 for example), I don't know how to get the maxResults of my query (I mean the total amount of result that Alfresco can give me with this query). And I need this to :
- know if there are more results
- know how many pages of results are lasting
I'm using a workaround for the first need : I'm doing a query for (maxItems+1), and showing only maxItems. If I have maxItems+1, I know that there are more results. But this doesn't give me the total amount of result.
Do you have any idea ?