[Python client] combining mapreduce with riak search

Hector Castro hector at basho.com
Tue Jun 10 09:30:56 EDT 2014


Hey,

Have you taken a look at the MapReduce API documentation outlined below? There is a specific method for combining search and MapReduce:

http://basho.github.io/riak-python-client/query.html#mapreduce

-- 
Hector

On June 2, 2014 at 2:51:47 PM, skydelta98 (skydelta98 at gmail.com) wrote:
> Hi,
> 
> I am trying to apply a mapreduce query after doing a full document seach on
> the bucket:
> 
> client = riak.RiakClient(protocol='http', host='xx.xx.xx.xx',
> http_port=8098)
> 
> s = client.fulltext_search('tweets', 'campaign_id:3')
> 
> s.map("""function(v) { var data = JSON.parse(v.values[0].data);
> if(data.tweet.match(/GS/i)) { return [[v.key, data]]; } return []; }""")
> 
> i followd this appoach as specified in this tutorial:
> http://imcol.in/2012/04/combining-mapreduce-with-riak-search/
> 
> the problem is the code i pasted below willl not work , simply because the
> method fulltext_search will return a dictionnary , how could i apply a
> map/reduce query from the result of a fulltext search ?
> 
> and thanks for you help
> 
> 
> 
> --
> View this message in context: http://riak-users.197444.n3.nabble.com/Python-client-combining-mapreduce-with-riak-search-tp4031182.html 
> Sent from the Riak Users mailing list archive at Nabble.com.
> 
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
> 





More information about the riak-users mailing list