jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@day.com>
Subject Re: NodeIterator.getSize() returns -1 for query with order by clause
Date Sun, 25 Apr 2010 20:32:14 GMT
On Fri, Apr 23, 2010 at 15:47, Simon Gaeremynck <gaeremyncks@gmail.com> wrote:
> I'm aware that according to the spec -1 can be returned (for various performance issues)
and that's all fine.
> But I thought you would be able to get the amount of results when the result set count
is smaller then the
> resultFetchSize you can specify for SearchIndex in the repository.xml ?

Not necessarily, I believe. This was the case for Jackrabbit 1.x, if I
am not mistaken.

> As previously stated, an order by gives a correct number, but as it is possible that
we might have huge datasets at some point,
> I really don't want to sort them.

AFAIK "order by @jcr:score descending" is the default sort order, so I
don't think it is way much slower than not sorting.

> This is also for doing paging, and we're already doing the "Page 1 of hundreds." thing,
but our UI developers are
> complaining that it should be possible to get a count when they only get a small resultset.

Any implementation that would by default count (ie. not having the -1
option) would be slower, or as slow as adding that order by. The -1 is
there to make it faster, if you don't need the count. I thought I made
that clear in my earlier mail.


Alexander Klimetschek

View raw message