jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: NodeIterator from QueryResult is lazy? or how to paginate query results
Date Tue, 07 Feb 2006 09:56:41 GMT
Alexandru Popescu wrote:
> Hi!
> 
> I haven't been able to find this documentation in the spec, nor around 
> Jackrabbit, so please excuse me if I just missed it.
> 
> I am wondering if the NodeIterator returned from a QueryResult is a 
> lazy-loading iterator or the QueryResult fetches the nodes right away?

this is implementation dependent. Jackrabbit loads the nodes on a lazy 
basis.

one exception though: if nodes need to be returned in document order, 
all result nodes are loaded from storage to calculate their document 
order. That information is not present in the index.

> I have reached this question, while trying to figure out how to paginate 
> the nodes returned by a Query. I could not found a way to query for a 
> specified number of nodes, is there a way? Even better would be to be 
> able to retrieve a number of nodes from a specific index, but still no 
> hints how to do this.

you can use e.g. NodeIterator.skip(30) to return matches number 31 and 
higher.

regards
  marcel

Mime
View raw message