incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Anderson <jch...@apache.org>
Subject Re: Sorting view queries
Date Fri, 03 Jul 2009 19:22:35 GMT
On Fri, Jul 3, 2009 at 9:37 AM, Geoff Buesing<geoff@geoffbuesing.com> wrote:
> On Fri, Jul 3, 2009 at 6:59 AM, Robert Newson <robert.newson@gmail.com>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

Mime
View raw message