Return-Path: Delivered-To: apmail-incubator-couchdb-user-archive@locus.apache.org Received: (qmail 62108 invoked from network); 28 Nov 2008 01:32:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Nov 2008 01:32:46 -0000 Received: (qmail 37489 invoked by uid 500); 28 Nov 2008 01:32:56 -0000 Delivered-To: apmail-incubator-couchdb-user-archive@incubator.apache.org Received: (qmail 37459 invoked by uid 500); 28 Nov 2008 01:32:56 -0000 Mailing-List: contact couchdb-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: couchdb-user@incubator.apache.org Delivered-To: mailing list couchdb-user@incubator.apache.org Received: (qmail 37448 invoked by uid 99); 28 Nov 2008 01:32:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Nov 2008 17:32:56 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [64.22.68.8] (HELO assmule.apisnetworks.com) (64.22.68.8) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Nov 2008 01:31:29 +0000 Received: from [192.168.0.11] (206-248-172-247.dsl.teksavvy.com [206.248.172.247]) by assmule.apisnetworks.com (Postfix) with ESMTPSA id 8E5028553 for ; Thu, 27 Nov 2008 20:32:15 -0500 (EST) Message-ID: <492F4A16.1090308@silencegreys.com> Date: Thu, 27 Nov 2008 20:32:06 -0500 From: Jedediah Smith User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: couchdb-user@incubator.apache.org Subject: Re: threaded email view References: <492A505E.5050104@silencegreys.com> <78ea81000811270416h3804f94fyb35a227c57fbc78a@mail.gmail.com> <492EA96F.3080603@gmail.com> In-Reply-To: <492EA96F.3080603@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org This works if emails always list all of their ancestors in the references field. If that is indeed the case then I wasn't aware of it and it certainly makes my task simpler. I am however still interested in the case where nodes of a data structure only link to their immediate parent, just or the sake of discussion. Thomas Kerpe wrote: > Hoops, sorry for that html and broken Text-part: > > function(doc) { > if (doc.type == "email") { > thread = []; > if (doc.header.references){ > thread = doc.header.references.split(" "); > } > thread.push(doc.header['message-id']); > thread_id = thread[0]; > emit([thread_id, thread,], doc.header.subject); > } > } > > //Thomas