Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4322B10B20 for ; Tue, 15 Oct 2013 13:25:13 +0000 (UTC) Received: (qmail 45286 invoked by uid 500); 15 Oct 2013 13:25:06 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 44887 invoked by uid 500); 15 Oct 2013 13:25:06 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 44876 invoked by uid 99); 15 Oct 2013 13:25:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Oct 2013 13:25:05 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gs@redcometlabs.com designates 74.125.82.170 as permitted sender) Received: from [74.125.82.170] (HELO mail-we0-f170.google.com) (74.125.82.170) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Oct 2013 13:25:00 +0000 Received: by mail-we0-f170.google.com with SMTP id u57so8629486wes.1 for ; Tue, 15 Oct 2013 06:24:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-type:message-id:mime-version :subject:date:references:to:in-reply-to; bh=zcXvhVVgqObGuYKACgZ5Opt54IMUD9+z9LZ/JN+m9xY=; b=f7idTpJvQFCRl5LY24e+RZJsMG0xsaFMsNMQEyBxrVKScw7rBRT+eFEYi49sns7sPc 3XWjTgmXwuTbnR9klUfu5YyX6YX6bOTBoXFWgZ4TulUfWJRXkiq3+cCqxzBsmGW5lxbp mRExK1GqejRhQl73FHp6JzeF3/2hQeNSuTScr4hI28i5qq69KBrHYX3LUhtR1jNC2Wsp R3xBHAqPe7KARBpySuRSDc5NO4MT7b+hazBYMt6Oemv8d1ZdlV9JQLUg2XIqbXGq/Sfb QqqFWsMmchPR7nwtp1jAxPPyDBX45tiVMoCmoboMmIRh6W0p5nZ99mY0NJKdCsBNk8+z /YEA== X-Gm-Message-State: ALoCoQmEOzyNdsxKVm9riyuQfi+BNZSRPZPQVGVt+2oBIyAjPRjSxNo0fewp5swF3gOJXPIhtSmr X-Received: by 10.194.119.106 with SMTP id kt10mr1182001wjb.72.1381843478313; Tue, 15 Oct 2013 06:24:38 -0700 (PDT) Received: from [192.168.0.3] (105-236-209-59.access.mtnbusiness.co.za. [105.236.209.59]) by mx.google.com with ESMTPSA id iz19sm6187662wic.9.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Oct 2013 06:24:37 -0700 (PDT) From: Garren Smith Content-Type: multipart/alternative; boundary="Apple-Mail=_21FF711E-B956-42DC-860F-33C107D6220B" Message-Id: <6F72805A-F8AA-4C88-97E9-239346FDC40E@apache.org> Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: Strange values for "total_rows" and "offset" Date: Tue, 15 Oct 2013 15:24:33 +0200 References: <305D22F7-FD26-4142-B749-34A52A2AA6CC@apache.org> <2B8ADCE1-6AA1-4674-AB46-F62B28CFCFC4@apache.org> To: user@couchdb.apache.org In-Reply-To: <2B8ADCE1-6AA1-4674-AB46-F62B28CFCFC4@apache.org> X-Mailer: Apple Mail (2.1510) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_21FF711E-B956-42DC-860F-33C107D6220B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 Hi Hank, Here is some documentation on how to do pagination with Couchdb.=20 = http://docs.couchdb.org/en/latest/couchapp/views/pagination.html?highlight= =3Dpaginate Cheers Garren On 15 Oct 2013, at 3:19 PM, Robert Newson wrote: >=20 > Sadly not. >=20 > On 15 Oct 2013, at 13:56, Hank Knight wrote: >=20 >> I need the total rows matching my query so I can do proper pagination = based >> on a query. Is this possible? >>=20 >>=20 >> On Tue, Oct 15, 2013 at 9:42 AM, Robert Newson = wrote: >>=20 >>> total_rows is the total number of rows in the view, not that match = your >>> query. >>>=20 >>> B. >>>=20 >>> On 15 Oct 2013, at 13:38, Hank Knight wrote: >>>=20 >>>> There are only 10 matching results where the key is "GOLD": >>>> http://example.com/abc/_design/iws/_view/q?key=3D%GOLD%22 >>>>=20 >>>> However the first line of the response is this: >>>>=20 >>>> {"total_rows":52340,"offset":218,"rows":[ >>>>=20 >>>> Why doesn't it say this? >>>>=20 >>>> {"total_rows":10,"offset":0,"rows":[ >>>>=20 >>>> The problem is that when I limit results like this: >>>>=20 >>>> = http://example.com/abc/_design/iws/_view/q?key=3D%GOLD%22&limit=3D5&skip=3D= 0 >>>>=20 >>>> I cannot tell from the response if that response includes all = matches or >>>> only the first five. >>>=20 >>>=20 >=20 --Apple-Mail=_21FF711E-B956-42DC-860F-33C107D6220B--