Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 5232 invoked from network); 10 Jun 2010 20:50:27 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 10 Jun 2010 20:50:27 -0000 Received: (qmail 14017 invoked by uid 500); 10 Jun 2010 20:50:26 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 13985 invoked by uid 500); 10 Jun 2010 20:50:26 -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 13967 invoked by uid 99); 10 Jun 2010 20:50:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Jun 2010 20:50:26 +0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=AWL,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.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; Thu, 10 Jun 2010 20:50:21 +0000 Received: by wyg36 with SMTP id 36so365258wyg.11 for ; Thu, 10 Jun 2010 13:49:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=+Am2E/bKTQzaEcDbph+sD0heHnbyUr6D8npjvMb/qwo=; b=L5kVRFdVZiu9RdfIneCLolc6eRMS+TlXqJAdB/497RyagN5DQEy0t63nVf8Kwagg65 pCAeRjUpZMXLhM/w+I/aZTQPHqBpzmTsdi3g+qvneuCccPuUrdn+rgbany1DK4nMY3+9 mQEMnkaaXfvKDbapJZuG3hf7p6frlkYS6OSJ8= 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=qt16qZMIBd6Xj+hBqAfRrEerFeR5KtMBkIkFWO9+rgFQj6gYYHsfoY3SjeZz8ydw81 4K3Ul89qeiPCUxCc6ZGINWGuIx+9Af+45DpEOSwiSeJ7ZeW4H24+E9Bqrqq4/MvjkVVT 3O582jm23upHFlulRkl0wok2/zw+wZ38n2UZw= MIME-Version: 1.0 Received: by 10.216.89.202 with SMTP id c52mr365772wef.66.1276202999872; Thu, 10 Jun 2010 13:49:59 -0700 (PDT) Received: by 10.216.20.136 with HTTP; Thu, 10 Jun 2010 13:49:59 -0700 (PDT) In-Reply-To: References: Date: Thu, 10 Jun 2010 21:49:59 +0100 Message-ID: Subject: Re: couch lucene From: Robert Newson To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I guess you could force the developer to return a JSON object with all those settings in them. For me, it made more sense to let them programmatically build an object. It also eliminated the expensive object-to-JSON conversion in previous versions. You are under no obligation to follow the couchdb-lucene programming model. That's my invention, not CouchDB's. Do whatever makes sense for your project. B. On Thu, Jun 10, 2010 at 8:53 PM, Norman Barker wr= ote: > Hi Robert, > > it seems I can fake a document object in spidermonkey (as I would like > to be compatible with Java Lucene) by doing var document =3D new > MyDocument(); where my MyDocument is an object we have defined. > However looking over your code I suggest that we could just use > > { > =A0"value": _, > =A0"type" : _, > =A0"field" : _ > } > > as the return and keep with JSON parsing as the message protocol as > per CouchDB. > > I know that JSON doesn't have a date type, but the type definition > overrides that. > > Your comments appreciated as I am probably missing something. > > Norman > > On Thu, Jun 10, 2010 at 1:36 PM, Norman Barker = wrote: >> Robert, >> >> thanks, I am looking at the examples in your code. So >> >> var ret=3Dnew Document(); ret.add(parseInt(\"12.5\"), {type:\"int\", >> field:\"num\"}); >> >> I still don't see why you need the document object, why not just a >> JSON structure? >> >> 'new Document()' does cause a problem in SpiderMonkey for me when I am >> calling it from clucene but I will try to get it to work. >> >> Norman >> >> On Thu, Jun 10, 2010 at 12:55 PM, Robert Newson wrote: >>> The example on the wiki page is the most trivial example. Look at the >>> examples at http://github.com/rnewson/couchdb-lucene for less trivial >>> ones. >>> >>> The reason for a Document object is that there are many different ways >>> to index your date (different fields, numeric, date, tokenized, not >>> tokenized, stored, not stored, etc). >>> >>> B. >>> >>> On Thu, Jun 10, 2010 at 7:49 PM, Norman Barker wrote: >>>> Hi, >>>> >>>> why in >>>> >>>> http://wiki.apache.org/couchdb/Full_text_search >>>> >>>> does the index function create a new document and add results to it? >>>> >>>> is it equally valid just to return a string? >>>> >>>> I have nearly finished the clucene integration now, I will be posting >>>> some code towards the end of the week. >>>> >>>> If I have missed something with the new Document() in the index js >>>> function please let me know. >>>> >>>> thanks, >>>> >>>> Norman >>>> >>> >> >