From user-return-5370-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Fri Jul 03 19:22:58 2009 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 71737 invoked from network); 3 Jul 2009 19:22:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Jul 2009 19:22:57 -0000 Received: (qmail 66465 invoked by uid 500); 3 Jul 2009 19:23:07 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 66389 invoked by uid 500); 3 Jul 2009 19:23:07 -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 66379 invoked by uid 99); 3 Jul 2009 19:23:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Jul 2009 19:23:07 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jchris@gmail.com designates 209.85.220.228 as permitted sender) Received: from [209.85.220.228] (HELO mail-fx0-f228.google.com) (209.85.220.228) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Jul 2009 19:22:56 +0000 Received: by fxm28 with SMTP id 28so3111102fxm.11 for ; Fri, 03 Jul 2009 12:22:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=5DruAguzKVwSu4sj86aIGcMOMoWYizrRt1qEnWVDCiA=; b=bS+WFN9QLeShiOmKhIkd5iurvF23FkbB8SXugvrUh3nSAb0iKABRXOdbcyQMDzhnyy l6Ph6JU78TiqyrAR0SOkN2bQ5KwfvEm18nAQ7Nx8qGdL+U0JgHmgkrCqlO+KHXQKiWXF peTRQdJ9hwwsceBBElrb3HBV/WjHnKQvt0rIk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=n3QNtqQ9R1/Ly5LhkCVlwb/F8YzW43AjbarlTJfmIK22x/jJ5TxkQ1CoD+SoLhZdm3 s/+/J3YfFcGapiH8+CLODe7OYSWev4h+CSyALTSERFj0Lm9XtnzBi27rAL6jFSTXOYM8 WkdMZ7+Enn0VGyLL6eVWwUBEJXwzwZnstOTng= MIME-Version: 1.0 Sender: jchris@gmail.com Received: by 10.204.113.208 with SMTP id b16mr1541851bkq.179.1246648955738; Fri, 03 Jul 2009 12:22:35 -0700 (PDT) In-Reply-To: <755ede320907030937x1e0ce1cex3669845c8fe17400@mail.gmail.com> References: <4A4DEF10.3000002@vpro.nl> <46aeb24f0907030459r7787bb2fj54415f2cc7a54a91@mail.gmail.com> <755ede320907030937x1e0ce1cex3669845c8fe17400@mail.gmail.com> Date: Fri, 3 Jul 2009 12:22:35 -0700 X-Google-Sender-Auth: 33b1ab89cfc78b77 Message-ID: Subject: Re: Sorting view queries From: Chris Anderson To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On Fri, Jul 3, 2009 at 9:37 AM, Geoff Buesing wrote: > On Fri, Jul 3, 2009 at 6:59 AM, Robert Newson wrote: > >> wouldn't emitting the start timestamp as the key solve the problem? >> (if you need both, have two views). > > > That would just return upcoming events, it wouldn't return current events > that have already started but have yet to end. > The pattern used on http://jchrisa.net/cal/_design/cal/index.html is to emit once an hour for every hour the event is active, this way you can always query for current events (use 15 minutes or 1 minute granularity if that fits your model better) > I think you could do this with couchdb-lucene, though, something like: > > q=starttime:[current_time TO far_future_time] OR endtime:[current_time TO > far_future_time] > &sort=starttime > -- Chris Anderson http://jchrisa.net http://couch.io