Bug in "Document.Query" with param "currentPageIndex"
Hi,
I'm use Automation Client to connecto to Nuxeo REST API. I use “Document.Query” operation. My client said me that only like 2 Page. The result of search is 2 documents, and pageSize is 5.
I call for first Page with currentPageIndex=1, but when y call to retrieve a second Page with currentPageIndex=2, I obtain the same result.
I think this second time I must obtain a null.
Thanks JMPrieto
Hi José Manuel,
I am using the REST API of automation with Document.Query from REST client (ie. Postman) and results are always OK. In fact, the parameters pageIndex and currentPageIndex are working showing the elements and current page with no problems. I think that the problem could be the setup of parameters on the client. Anyway, I recommend to you, check the Document.Query like me, and check the client source code to ensure that params are setting properly.
You can find the source code of Document.Query automation here:
, to ensure the parameters and/or to find any bug from your client.
Hope that helps.
Regards, VS!
Thanks Victor,
Your link is broken but help me to find the correct link: https://github.com/nuxeo-archives/nuxeo-features/blob/master/nuxeo-automation/nuxeo-automation-features/src/main/java/org/nuxeo/ecm/automation/core/operations/services/query/DocumentPaginatedQuery.java
Nuxeo not has a BUG. If you request a Query with currentPageIndex= 5 and with pageSize= 5, but the query only return two Documents. The response object is a list of Document. But response object is a PaginatedDocument not a Document. (PaginatedDocument extends Document).
PaginatedDocument has the attribute “currentPageIndex”, and it says 0, not 5.
Thanks.
that broken-link was updated at first, you can find the valid link in my answer.
May be, the currentPageIndex value of document adapter into model list is relative to result pages, not to configuration of the executed query provider. What do you think?
Regards, VS!