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 <srikrishnamo...@gmail.com> 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=='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.new...@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 <srikrishnamo...@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
>> >
>>
>

Reply via email to