couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Norman Barker <norman.bar...@gmail.com>
Subject Re: couch lucene
Date Thu, 10 Jun 2010 19:53:42 GMT
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 = new
MyDocument(); where my MyDocument is an object we have defined.
However looking over your code I suggest that we could just use

{
  "value": _,
  "type" : _,
  "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 <norman.barker@gmail.com> wrote:
> Robert,
>
> thanks, I am looking at the examples in your code. So
>
> var ret=new 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 <robert.newson@gmail.com> 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 <norman.barker@gmail.com> 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
>>>
>>
>

Mime
View raw message