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 AF9F210494 for ; Mon, 22 Jul 2013 16:26:27 +0000 (UTC) Received: (qmail 39964 invoked by uid 500); 22 Jul 2013 16:26:26 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 39738 invoked by uid 500); 22 Jul 2013 16:26:25 -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 39730 invoked by uid 99); 22 Jul 2013 16:26:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Jul 2013 16:26:24 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW X-Spam-Check-By: apache.org Received-SPF: error (athena.apache.org: local policy) Received: from [74.125.83.42] (HELO mail-ee0-f42.google.com) (74.125.83.42) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Jul 2013 16:26:18 +0000 Received: by mail-ee0-f42.google.com with SMTP id c4so4032039eek.1 for ; Mon, 22 Jul 2013 09:25:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:content-type:content-transfer-encoding:subject:date:message-id :to:mime-version:x-mailer:x-gm-message-state; bh=sD9yxQ04oLiiDoHU9+rBMdW31CPDOPi5YBP5D49SkvM=; b=D0vDOHWbjlgfecLBwbDSK6nCJlKv08b38YBjmSG221WbLuqYj/LbMXiFXGSMGaJhbs NFIZjhb14gmFISwvAM5zgfFR3WJFpXh1wMHO9WZ0ITgdxWlHbwcePrVHJP/jTOhmeOJn 9KFvOXL8uOV5jT/U9o2mznrs33cgjEfYjODNvJGtZLshtv7fHJN2l+PWj4915H6d3FoC gXM6K3h8Pwds+Av82RdT4Qer2DCddcDgWpEBlJ9JiBr5yxfbZ/UxbopPQHxmnPQzxUZB 4a2+Z9kkJ+F4bUVw4GLRaQnw9nfyRAL8YLrcYODlBJMAoxlaprIj4woz2Z8MwC0neMqC ECFg== X-Received: by 10.14.173.70 with SMTP id u46mr28143120eel.92.1374510336498; Mon, 22 Jul 2013 09:25:36 -0700 (PDT) Received: from [192.168.2.112] ([77.72.35.178]) by mx.google.com with ESMTPSA id r54sm51933127eev.8.2013.07.22.09.25.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 09:25:35 -0700 (PDT) From: Filippo Fadda Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: Get the 20 posts, of the last seven days, ordered by number of hits Date: Mon, 22 Jul 2013 18:25:33 +0200 Message-Id: To: user@couchdb.apache.org Mime-Version: 1.0 (Apple Message framework v1283) X-Mailer: Apple Mail (2.1283) X-Gm-Message-State: ALoCoQmKpKcK1Lc1o0G/DGjyTF6i0vyA7yet3TWreg9hDJpkZ71XRzweqkku20BA8q/Ioe8RZKiC X-Virus-Checked: Checked by ClamAV on apache.org Let's suppose I have a blog and I want display the popular posts, where = popular means: the 20 posts, of the last seven days, ordered by number = of hits. To avoid conflicts I don't save the number of hits in the post itself, = but I emit a new document every time a generic user displays a post. Even using view collation I don't get a solution for this problem. -Filippo=