jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ard Schrijvers" <a.schrijv...@onehippo.com>
Subject RE: Query result with offset/limit
Date Thu, 07 Aug 2008 21:29:40 GMT
Hello,

> 
> In the second same search (for second page), I do set:
> QueryImpl.setLimit(2);
> QueryImp.setOffset(2);
> This way I pretend to get two records, starting from the 
> record nro 3, which would be only the node4.
> But, the result I got is node3 (again) and node4, because the 
> offset worked not according to the grantacess (provided by 
> the security class), but according to the sequence of the raw result.

I do understand your issue. It would be nice to somehow know from each
result node what its offset was. OTOH, this offset might only be
temporarily valid, because while paging to the next page, nodes might
have been added/removed. Because you are just getting an iterator over
search results, you won't be able to add information about the offset
(in other words, what was the nodes hitposition in the lucene search).

I think it is really valuable information, which currently isn't
accessible. AFAIK, this is still not available in the jsr-283. 

So, bottom line, I am not really sure how to solve it in your
case(smart, without getting *all* the authorized results). You will also
hit this problem when you want to display the number of pages, because
you can only know this number *after* you authorized every hit. Also,
your concept might be a huge bottleneck for users having very few
permissions to see nodes: if you have to grant  thousands of nodes to
find for example 10 granted ones, you'll get problems. 

Unless....you make sure that the lucene query gets combined with an
authorisation query such that almost every hit you get is an authorised
hit as well. This is not trivial, but certainly not impossible, since we
did it :-)...but don't expect to have something like it within a couple
of hours, it is not really trivial

Ard 

> 
> Is there some way to my application handle this offset to 
> start in the correct position (counting only the granted 
> nodes and not all of them)? Or maybe is this an issue?
> 
> Hope this make sense for you.
> 
> Thanks.
> Helio.
> --
> View this message in context: 
> http://www.nabble.com/Query-result-with-offset-limit-tp1887902
> 0p18879020.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
> 
> 

Mime
View raw message