jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: Query result with offset/limit
Date Fri, 08 Aug 2008 09:04:20 GMT
Hi Helio,

I'd say this is a bug. Can you please create a jira issue? thank you.

regards
  marcel

hsp_ wrote:
> 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.


Mime
View raw message