Anton,

Sorry for the delay. Yes you can use MapReduce link-phases in a similar way,
but unlike the link-walking resource, the objects pointed to in each phase
will not be returned.  The way link-walking does its work is to split the
URL into segments for each phase that has keep=true (1), then issue a
MapReduce request for the traversal up to the first keep, then take the
results of that and feed it to another that goes up to the next keep, and so
on.  So your link-walking query is actually more like:

[users/userid] -> link(projects, _, 1) -> map_value
(results from previous) -> link(parts, _, 1) -> map_value
(results from previous) -> link(units, _, 1) -> map_value


On Mon, Oct 17, 2011 at 2:21 PM, Anton Podviaznikov
<[email protected]>wrote:

> Hi,
>
> I had question about Link walking.
> I need to walk links in few levels and keep results from previous steps.
> I managed to achieve this using URL syntax
> /users/userid/projects,*,1/parts,*,1/units,*,*
> Here I find all user's projects than parts and finally units.
>
> However I couldn't achieve the same results using map-reduce and link
> phases.
>
> curl -X POST -H "content-type: application/json"
> http://localhost:8098/mapred --data @-<<\EOF
> {"inputs":[["users","userid"]],"query":[{"link":{"bucket":"projects","keep":true}},{"link":{"bucket":"parts","keep":true}},{"link":{"bucket":"units"}},{"map":{"language":"javascript","source":"function(v)
> { return [v]; }"}}]}
> EOF
>
>
> I got full documents from last step but for projects and parts I got only
> bucket, key and tag (there was no document body and metadata).
>
> Is it some problem in map function? Any hints, advises?
>
> Best regards,
> Anton Podviaznikov
>
> _______________________________________________
> riak-users mailing list
> [email protected]
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>


-- 
Sean Cribbs <[email protected]>
Developer Advocate
Basho Technologies, Inc.
http://www.basho.com/
_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to