Yes, like Rakesh said, it is from an optimisation (-1 means unknown). When I really need the number of results, I add an "order by" clause to force in my query and then, it don't returns -1 anymore. Be aware that it may be less efficient.
F Le 2010-03-19 à 4:41 PM, Rakesh Vidyadharan a écrit : > > On 19 Mar 2010, at 14:50, Rodrigo Meza wrote: > >> Hello, >> I am not sure if this is the right list to make my question, but I >> didn't find a jcr-2 list. My problem is that queries in jackrabbit >> sometimes return -1: > > I think there have been a couple of earlier posts on this issue. I myself > had to change my JCR-1 code due to this issue. IIRC JR people decided to > optimise the results processing by not iterating over the results and > populating the size. I ended up doing that on my end, which hopefully was > all that JR1 was doing. > > Rakesh
