jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torgeir Veimo <torgeir.ve...@gmail.com>
Subject Re: getSize() == -1 with oak
Date Thu, 24 Jul 2014 10:50:04 GMT
Previously, one could do a

long totalCount = it.getSize();

Do you mean I need to do a

NodeIterator it = res.getNodes(); long totalCount = 0;
while (it.hasNext()) {
  Node node = it.nextNode(); totalCount++;
}

Why I need to know the count is irrelevant. I don't think it's up to
the persistence layer to dictate policy for the user interface.

On 21 July 2014 20:39, Thomas Mueller <mueller@adobe.com> wrote:
> Hi,
>
> You would need to traverse the result. Which is a bad idea if the result
> is big.
>
> The question is: why do you need to know? Do you want to display a page
> number ("page 1 of 145")? I think that's not a good idea, for multiple
> reasons.
>
> Regards,
> Thomas
>
> On 16/07/14 19:32, "Torgeir Veimo" <torgeir.veimo@gmail.com> wrote:
>
>>What's the correct approach to getting a total count from a query
>>result with apache oak?
>>
>>Using 'order by @jcr:score' doesn't seem to work as it does with
>>Jackrabbit.
>>
>>--
>>-Tor
>



-- 
-Tor

Mime
View raw message