cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in "Document.Query" with param "currentPageIndex"

José_Manuel_Pri
Champ in-the-making
Champ in-the-making

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

5 REPLIES 5

Victor_Sánchez
Confirmed Champ
Confirmed Champ

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:

https://github.com/nuxeo/nuxeo/blob/6.0/nuxeo-features/nuxeo-automation/nuxeo-automation-features/sr...

, to ensure the parameters and/or to find any bug from your client.

Hope that helps.

Regards, VS!

José_Manuel_Pri
Champ in-the-making
Champ in-the-making

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-featu...

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.

Hi José Manuel,

You are in true, but if I request for Apples why Nuxeo response Flowers. I think response must be an Exception. If you request something that I can't have, my response must be "Sorry, Its impossible to satisfy your request because...". Or not?

When doing paging it's quite common to return 0-sized answers. As documents could have been concurrently removed, it's would be quite bad to crash with an exception just because the page you're now on doesn't have any documents left.