On Fri, Aug 28, 2009 at 9:55 PM, Paul Davis<[email protected]> wrote: >> in this case I'm reducing the result, but the output is greater the >> half the size of the input. For what I've understood this would fail, >> wouldn't it? > > Yep. And this is a poster child of the sort of thing this patch was > trying to catch. The CouchDB-y way to do this would be to emit like > such: > > Doc1 > [k1, id(F1)] -> F1 > [k1, id(F2)] -> F2 > [k1, id(F3)] -> F3 > [k1, id(F4)] -> F4 > [k1, id(F5)] -> F5 > > Doc2 > [k1, id(F1)] -> F1 > [k1, id(F3)] -> F3 > > And then call your reduce with a group=true. >
This was my first approach and in general it works for the purpose. The only problem is when the features are not independent one of each other. I guess that in that case the only approach is to download all the [k1, features] and handle them in the client (same problem as sorting reduce results). -- Fabio Forno, Ph.D. Bluendo srl http://www.bluendo.com jabber id: [email protected]
