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 2636510C4A for ; Tue, 22 Oct 2013 17:53:16 +0000 (UTC) Received: (qmail 93352 invoked by uid 500); 22 Oct 2013 17:53:13 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 91066 invoked by uid 500); 22 Oct 2013 17:53:08 -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 89881 invoked by uid 99); 22 Oct 2013 17:53:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Oct 2013 17:53:04 +0000 X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of siriele2x3@gmail.com designates 209.85.216.181 as permitted sender) Received: from [209.85.216.181] (HELO mail-qc0-f181.google.com) (209.85.216.181) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Oct 2013 17:52:58 +0000 Received: by mail-qc0-f181.google.com with SMTP id w4so4913294qcr.12 for ; Tue, 22 Oct 2013 10:52:38 -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=2Ri83J8rPUfpuhjWziyC2wFSj6H+vxb2lHnlFtOHrnk=; b=VKHqRbTlIg+EsTHoGaC3428Pgd4YLZlnR3P28dishcMJRQKR3BpKIqnDj91ph8maTg D1VknWllawklTsHl7MEDtGJ0EBqeuJ/hOIAB3guhfWJkhwYCIcsZ0JT1Uw9MSskHtmG2 //0u9TPBhoQzLxSWY97lv5HMNZx7lYh0IXJkZT3r0sJyBjC74/Hyhz8BOgT3+pfzLfmO 31TQy9l0UE4itS3g8DSPPvqdfGW0wXRqeGoAp8bvcm9QIFdGrv49ojjTcRv2D6Qd3jta ykHRCQ+Ux5mWlNDahFjSkvS8+dpM+fvNOJsa9tS3jpnUZvbgvIpOyLgUpndEl5yRUonV zeGw== MIME-Version: 1.0 X-Received: by 10.224.38.2 with SMTP id z2mr3790735qad.121.1382464357874; Tue, 22 Oct 2013 10:52:37 -0700 (PDT) Received: by 10.96.72.76 with HTTP; Tue, 22 Oct 2013 10:52:37 -0700 (PDT) Received: by 10.96.72.76 with HTTP; Tue, 22 Oct 2013 10:52:37 -0700 (PDT) In-Reply-To: References: Date: Tue, 22 Oct 2013 10:52:37 -0700 Message-ID: Subject: Re: CouchDB: Return Results in Random Order From: Stanley Iriele To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=001a11c2b2cef752a204e9581025 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c2b2cef752a204e9581025 Content-Type: text/plain; charset=ISO-8859-1 What are you trying to randomize? On Oct 22, 2013 6:23 AM, "Dave Cottlehuber" wrote: > On 22. Oktober 2013 at 14:29:16, Hank Knight (hknight555@gmail.com) wrote: > > > >This returns 10 results: > >http://localhost:5984/mydb/_design/type/_view/q?limit=10&key=%22xyz%22 > > > >Is there a way for the results to be returned in random order? > > As Bob says, no, but you can fake it. see > http://blog.chewxy.com/2012/11/16/random-documents-from-couchdb/basically you either do it at view build time, and rebuild periodically, or > do it at query time > http://sea-krait.blogspot.co.at/2011/03/cleaner-pseudo-randomized-views-in.htmlby abusing limits and skips. > > A+ > Dave Cottlehuber > Sent with Airmail > --001a11c2b2cef752a204e9581025--