couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ben Nevile" <>
Subject indexes and a waste of a good map reduce
Date Fri, 31 Oct 2008 01:35:03 GMT
Hi kids,
I'm hoping that there's something I don't understand about the way views
work.  Lend me your brains.  Is there any way to use the value of a
reduction as part of the index?

So let's say we've implemented a word count.  We have a nice view that is
indexed by word, so we can query any word and find out how many times it
appears.  But if we want to know what words are the most frequent, seems to
me that currently we're out of luck.

The only way I can see to do it is to operate in multiple phases: ie, phase
1 would be updating the above query, and phase 2 would be writing the
results of phase 1 into a different document type so that a subsequent
mapping could emit(word_count, word).  Hoping we can address this - all the
classes of problems I want to solve with couchdb involve using the
map-reduce algorithm for this type of multi-stage analysis.


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