jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hsp_ <piccina...@ibest.com.br>
Subject Query result with offset/limit
Date Thu, 07 Aug 2008 20:30:19 GMT

jackrabbit version is 1.4 (jackrabbit-core - 1.4.5).
I would to know if there is a workaround for the situation I will explain:
I use searches with result limit and offset but it is working some wrong for
my case.
Lets suppose the total of nodes that will return with the search:

NAME       GRANTACCESS    OFFSET
node1          true                     0
node2          false                    1
node3          true                     2
node4          true                     3
node5          false                    4

My page must have 2 records, so first I do a count for the search and get
size of 3 records (after filtered by my security class invoked automatically
by jackrabbit), so I have 2 pages to show to the user. The first page must
return 2 records, of course, and the second must return 1 record.

In the first search I do set:
QueryImpl.setLimit(2);
QueryImp.setOffset(0);

So, I get the nodes 1 and 3, thats correct.

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.

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-tp18879020p18879020.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Mime
View raw message