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 17E6C10E91 for ; Tue, 15 Oct 2013 19:20:27 +0000 (UTC) Received: (qmail 24856 invoked by uid 500); 15 Oct 2013 19:20:25 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 24812 invoked by uid 500); 15 Oct 2013 19:20:24 -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 24802 invoked by uid 99); 15 Oct 2013 19:20:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Oct 2013 19:20:23 +0000 X-ASF-Spam-Status: No, hits=-0.5 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of hknight555@gmail.com designates 74.125.82.48 as permitted sender) Received: from [74.125.82.48] (HELO mail-wg0-f48.google.com) (74.125.82.48) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Oct 2013 19:20:17 +0000 Received: by mail-wg0-f48.google.com with SMTP id b13so8071407wgh.15 for ; Tue, 15 Oct 2013 12:19:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=RDuogZSiUAR9CBTCRE6cwvHRAvNX/CCY6lxNR1eru0Y=; b=iAM+tpyX8datQ2S1oLy+U00Xla6I2RV7cPMQJGDjpnvnLXL7UjS8Aaw/drkAaP3EZH 3/QHYdfiDp0bsKzglwvmWTuonVVlIfmHKxjQlfIVVevT73BPKyGyoHbySrgkhyRV0YSR HKC6U2D9ocyaFiQ+Rs/DovE8WLNfHuat9Jt9gFI+xeffyCkETxm4XePMsJbZa28MYcqS kbWbM82XOcK5rKcPdxDvZbWHWKTL/IyXa3blKecAypcgMot6SGeVwJgMzPaIAdpV3Phw ts9C/8wbESR/o4OON38kvy/enUwkke8EpIavPjIChZO4FvQ8qyzAITn7t7hxXMOc4zz2 lq6A== MIME-Version: 1.0 X-Received: by 10.194.241.228 with SMTP id wl4mr36234070wjc.2.1381864796650; Tue, 15 Oct 2013 12:19:56 -0700 (PDT) Received: by 10.217.45.199 with HTTP; Tue, 15 Oct 2013 12:19:56 -0700 (PDT) In-Reply-To: <89D8D3C8-99B5-4AC3-BE47-57747A61F883@apache.org> References: <305D22F7-FD26-4142-B749-34A52A2AA6CC@apache.org> <2B8ADCE1-6AA1-4674-AB46-F62B28CFCFC4@apache.org> <89D8D3C8-99B5-4AC3-BE47-57747A61F883@apache.org> Date: Tue, 15 Oct 2013 16:19:56 -0300 Message-ID: Subject: Re: Strange values for "total_rows" and "offset" From: Hank Knight To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org I would highly recommend and appropriate making total_rows and offset optional. Ideally you would be able to control it like this: http://example.com/abc/_design/iws/_view/q?key=%GOLD%22&pagination=false On Tue, Oct 15, 2013 at 3:51 PM, Robert Newson wrote: > > Near zero, I'd say. The number is not cheaply computable with structures as they are. I would be ok with removing total_rows and offset from the output given that they're a bit silly, really. > > On 15 Oct 2013, at 19:05, Hank Knight wrote: > >> What are the chances of this feature being added to future releases of >> CouchDB? I am sure it would benefit many. >> >> >> On Tue, Oct 15, 2013 at 10:19 AM, Robert Newson wrote: >> >>> >>> Sadly not. >>> >>> On 15 Oct 2013, at 13:56, Hank Knight wrote: >>> >>>> I need the total rows matching my query so I can do proper pagination >>> based >>>> on a query. Is this possible? >>>> >>>> >>>> On Tue, Oct 15, 2013 at 9:42 AM, Robert Newson >>> wrote: >>>> >>>>> total_rows is the total number of rows in the view, not that match your >>>>> query. >>>>> >>>>> B. >>>>> >>>>> On 15 Oct 2013, at 13:38, Hank Knight wrote: >>>>> >>>>>> There are only 10 matching results where the key is "GOLD": >>>>>> http://example.com/abc/_design/iws/_view/q?key=%GOLD%22 >>>>>> >>>>>> However the first line of the response is this: >>>>>> >>>>>> {"total_rows":52340,"offset":218,"rows":[ >>>>>> >>>>>> Why doesn't it say this? >>>>>> >>>>>> {"total_rows":10,"offset":0,"rows":[ >>>>>> >>>>>> The problem is that when I limit results like this: >>>>>> >>>>>> http://example.com/abc/_design/iws/_view/q?key=%GOLD%22&limit=5&skip=0 >>>>>> >>>>>> I cannot tell from the response if that response includes all matches >>> or >>>>>> only the first five. >>>>> >>>>> >>> >>> >