Paging in NXQL

We have Nuxeo EP 5.5 deployed at one of our server. Our application that is deployed on another computer using Nuxeo webservices to search document against a search criteria. Now there may be 10,000 records against this search criteria because we are incorporating Nuxeo EP 5.5 with our enterprise application.

As we are using nuxeo webservices to interact with Nuxeo so we'll have to slice this huge response as we are displaying the result at our front end (application) page by page (10 rows per page.)

Nuxeo does provide:

DocumentModelList docs = session.query(“SELECT * FROM DOCUMENT WHERE dc:title = '“+aTitle+“'“).subList(fromIndex, toIndex);

to break the result to chunks.

I want to know does NXQL provide any paging support? I want to do this at query level to further speedup the response.

0 votes

1 answers

1860 views

ANSWER

some clause in NXQL? :)
05/02/2012



There are various different signatures for CoreSession.query(), some of which like this take limit/offset values. Make sure that you ORDER BY in your query to get consistent results, for instance ORDER BY ecm:uuid.

1 votes



Also you may want to consider using CoreSession.queryAndFetch for more efficient returning of lots of values if you're not directly interested in the DocumentModel itself.
05/02/2012

Perfect! exactly what I wanted. Thanks Florent.
05/02/2012