From user-return-9228-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Tue Mar 09 17:38:51 2010 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 33906 invoked from network); 9 Mar 2010 17:38:51 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Mar 2010 17:38:51 -0000 Received: (qmail 12032 invoked by uid 500); 9 Mar 2010 17:38:23 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 12003 invoked by uid 500); 9 Mar 2010 17:38:22 -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 11995 invoked by uid 99); 9 Mar 2010 17:38:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Mar 2010 17:38:22 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of robert.newson@gmail.com designates 74.125.82.180 as permitted sender) Received: from [74.125.82.180] (HELO mail-wy0-f180.google.com) (74.125.82.180) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Mar 2010 17:38:15 +0000 Received: by wyb33 with SMTP id 33so186734wyb.11 for ; Tue, 09 Mar 2010 09:37:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=aC0nYufGJzHPUTfKKBOSZP8qdolKoN1hs6749ndD3Ek=; b=I24iEJ9F+dNgsXMVTGdL2jMw4rN8oP47Cv+46seUe5BubEFHfxM+vCJFqNEEQBn3Te cAsI2Jlp2yjWYIWVLnpIyS1RsBCH4jtP0ZocP4rSH3KPH7dayf2JkoOpjEgNFLqH33oQ PUT/H8EpiZaqjjtlBYFJ+yYHpHtW8k/htXBfs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=XiiUYbRYE0GcW3fkWqR3NIj16ePX1+6B04/TrKcxeoLc43czZsZMhD4Ay9G+vnaMZq WyC7Hu5LNRSGsq5YJpOL4KCZ6zKg5lPYzlLQdfpcEJrlN8Xeqa/7pvT31NziTmYoAbF0 Zq/PvTUl3nVSZZ4wC2wLQDe65qHPQ0u+BPSSo= MIME-Version: 1.0 Received: by 10.216.165.148 with SMTP id e20mr96356wel.29.1268156274691; Tue, 09 Mar 2010 09:37:54 -0800 (PST) In-Reply-To: References: <46aeb24f1003090853s45a60774wd41e59dbf2617418@mail.gmail.com> Date: Tue, 9 Mar 2010 12:37:54 -0500 Message-ID: <46aeb24f1003090937n13db2749oa637d4c6e29d52ff@mail.gmail.com> Subject: Re: couchdb-lucene full text indexing From: Robert Newson To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org The example is broken for arrays, I guess. I'll post an update when I have time to test it, but for now the case statement for 'object' should be updated to correctly emit an array as a string. Perhaps others on the list have ideas? If you could post a ticket on github then I'll get on this when I have some time to test it. B. On Tue, Mar 9, 2010 at 11:58 AM, km wrote: > yes this is my full text function - derived from the couchdb-lucene > docs, for recursive indexig of nested levels in a document: > > function(doc) { if(doc.type=3D=3D'car'){ var ret =3D new Document(); > function idx(obj) { for (var key in obj) { switch (typeof obj[key]) { > case 'object':idx(obj[key]); break; case 'function': break; default: > if(obj[key]){ret.add(obj[key],{'field':key,'store':'yes'}); > ret.add(obj[key]);} break; =A0 } } }; =A0idx(doc); return ret; }} > > regards, > Krishna > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~ > On Wed, Mar 10, 2010 at 1:53 AM, Robert Newson w= rote: > >> Can you include your fulltext function? You can programmatically add >> any content to the index, so you might work around this by converting >> your array to a string yourself. If you show the function, I can >> verify if it's a bug in the function or in couchdb-lucene's conversion >> rules. >> >> B. >> >> On Tue, Mar 9, 2010 at 10:16 AM, km wrote: >> > Hi all, >> > >> > I notice =A0that in the full text indexing option, >> > the keys automatically generated when store is set to "yes" are the >> indexes >> > of the array and not the actual key. >> > forexample, in full text indexing mode, a dcument =A0like >> {key1:['a','b','c']} >> > produces 3 keys namely 0,1 and 2 instead of the expected key "key1" in >> this >> > case. >> > >> > any ideas to get the "key1" indexed and accessed forthe array ? >> > >> > Krishna >> > >> >