Return-Path: X-Original-To: apmail-jackrabbit-users-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B209A9C33 for ; Tue, 25 Oct 2011 14:49:05 +0000 (UTC) Received: (qmail 57801 invoked by uid 500); 25 Oct 2011 14:49:05 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 57774 invoked by uid 500); 25 Oct 2011 14:49:05 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 57766 invoked by uid 99); 25 Oct 2011 14:49:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Oct 2011 14:49:05 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of a.schrijvers@1hippo.com designates 64.18.2.167 as permitted sender) Received: from [64.18.2.167] (HELO exprod7og107.obsmtp.com) (64.18.2.167) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 25 Oct 2011 14:48:59 +0000 Received: from mail-pz0-f43.google.com ([209.85.210.43]) (using TLSv1) by exprod7ob107.postini.com ([64.18.6.12]) with SMTP; Tue, 25 Oct 2011 07:48:39 PDT Received: by mail-pz0-f43.google.com with SMTP id 33so1513837pzk.2 for ; Tue, 25 Oct 2011 07:48:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.32.234 with SMTP id m10mr37311747pbi.43.1319554118324; Tue, 25 Oct 2011 07:48:38 -0700 (PDT) Received: by 10.68.43.136 with HTTP; Tue, 25 Oct 2011 07:48:38 -0700 (PDT) In-Reply-To: References: Date: Tue, 25 Oct 2011 16:48:38 +0200 Message-ID: Subject: Re: How do I get the total size of nodes/rows from a QueryResult From: Ard Schrijvers To: users@jackrabbit.apache.org Content-Type: text/plain; charset=ISO-8859-1 On Tue, Oct 25, 2011 at 4:25 PM, wrote: > Hi all, > > > > I am currently switching to Jackrabbit 2.2.9 and have now a problem > getting the total size of nodes/rows in a query result. In Jackrabbit > 1.6 you could cast the QueryResult to QueryResultImpl and retrieve the > total size from there. That is not possible with Jackrabbit 2.2.9 > because I always get a SimpleQueryResult which doesn`t provide the > needed information. The total size is very important if you want to > implement a pagination. not sure if it is still the only way, but when adding an order by clause you'd be able to get the actual size. Thus add something like order by @jcr:score if you use xpath Regards Ard > > > > How do I get the total size of nodes or rows with Jackrabbit 2.2.9? > > > > Best regards > > > > Sascha Theves > > -- Amsterdam - Oosteinde 11, 1017 WT Amsterdam Boston - 1 Broadway, Cambridge, MA 02142 US +1 877 414 4776 (toll free) Europe +31(0)20 522 4466 www.onehippo.com