You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Hadley Wickham <ha...@rice.edu> on 2009/08/25 21:15:57 UTC

Map-reduce view without the reduce?

Hi all,

Is it possible to query a map-reduce view and return un-reduced
documents?  The canonical use would be when you are creating a keyword
index and you want to both count the number and retrieve all documents
that use a keyword (but not at the same time).  Creating two separate
views would seem to unnecessarily double the work for the map
component, since it's basically doing the same thing in each case.

Hadley

-- 
http://had.co.nz/

RE: Map-reduce view without the reduce?

Posted by Kevin Ferguson <ke...@meebo-inc.com>.
Hi Hadley, try adding the reduce=false option to your query string to skip the reduce step.  You can also add include_docs=true to get the original documents.

Details at:
http://wiki.apache.org/couchdb/HTTP_view_API

Kevin
________________________________________
From: h.wickham@gmail.com [h.wickham@gmail.com] On Behalf Of Hadley Wickham [hadley@rice.edu]
Sent: Tuesday, August 25, 2009 12:15 PM
To: user@couchdb.apache.org
Subject: Map-reduce view without the reduce?

Hi all,

Is it possible to query a map-reduce view and return un-reduced
documents?  The canonical use would be when you are creating a keyword
index and you want to both count the number and retrieve all documents
that use a keyword (but not at the same time).  Creating two separate
views would seem to unnecessarily double the work for the map
component, since it's basically doing the same thing in each case.

Hadley

--
http://had.co.nz/

Re: Map-reduce view without the reduce?

Posted by Paul Davis <pa...@gmail.com>.
Hadley,

?reduce=false

HTH,
Paul Davis

On Tue, Aug 25, 2009 at 3:15 PM, Hadley Wickham<ha...@rice.edu> wrote:
> Hi all,
>
> Is it possible to query a map-reduce view and return un-reduced
> documents?  The canonical use would be when you are creating a keyword
> index and you want to both count the number and retrieve all documents
> that use a keyword (but not at the same time).  Creating two separate
> views would seem to unnecessarily double the work for the map
> component, since it's basically doing the same thing in each case.
>
> Hadley
>
> --
> http://had.co.nz/
>

Re: Map-reduce view without the reduce?

Posted by hadley wickham <h....@gmail.com>.
On Tue, Aug 25, 2009 at 2:18 PM, Adam Wolff<aw...@gmail.com> wrote:
> You can query the view with reduce=false

Oops, that was obvious!  I was just reading
http://wiki.apache.org/couchdb/HTTP_view_API too.

Thanks for the help.

Hadley

-- 
http://had.co.nz/

Re: Map-reduce view without the reduce?

Posted by Adam Wolff <aw...@gmail.com>.
You can query the view with reduce=false

On Tue, Aug 25, 2009 at 12:15 PM, Hadley Wickham <ha...@rice.edu> wrote:

> Hi all,
>
> Is it possible to query a map-reduce view and return un-reduced
> documents?  The canonical use would be when you are creating a keyword
> index and you want to both count the number and retrieve all documents
> that use a keyword (but not at the same time).  Creating two separate
> views would seem to unnecessarily double the work for the map
> component, since it's basically doing the same thing in each case.
>
> Hadley
>
> --
> http://had.co.nz/
>