couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From km <srikrishnamo...@gmail.com>
Subject Re: couchdb-lucene full text indexing
Date Tue, 09 Mar 2010 16:58:51 GMT
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=='car'){ var ret = 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;   } } };  idx(doc); return ret; }}

regards,
Krishna
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
On Wed, Mar 10, 2010 at 1:53 AM, Robert Newson <robert.newson@gmail.com>wrote:

> 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 <srikrishnamohan@gmail.com> wrote:
> > Hi all,
> >
> > I notice  that 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  like
> {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
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message