diff --git a/Ansible/mapreduce.sh b/Ansible/mapreduce.sh new file mode 100644 index 0000000000000000000000000000000000000000..3e1eec1c8285bdf4cd90960f2859c2119dab4b03 --- /dev/null +++ b/Ansible/mapreduce.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +curl -X PUT http://172.26.130.79:5984/live_demo/_design/sports_by_city --data-binary @sports_by_city.json +curl -X PUT http://172.26.130.79:5984/live_demo/_design/retweets_followers --data-binary @retweets_followers.json +curl -X PUT http://172.26.130.79:5984/live_demo/_design/replies --data-binary @retweets_followers.json \ No newline at end of file diff --git a/Ansible/replies.json b/Ansible/replies.json new file mode 100644 index 0000000000000000000000000000000000000000..d377a7fb7140dee0b24dcce2e425614233549e5c --- /dev/null +++ b/Ansible/replies.json @@ -0,0 +1,10 @@ +{ + "_id": "_design/replies", + "views": { + "replies": { + "reduce": "_count", + "map": "function (doc) {\n if(doc.tags.length > 0) {\n for (var idx in doc.tags) {\n emit([doc.region, doc.tags[idx]],1)\n }\n }\n}" + } + }, + "language": "javascript" +} \ No newline at end of file diff --git a/Ansible/retweets_followers.json b/Ansible/retweets_followers.json new file mode 100644 index 0000000000000000000000000000000000000000..7d6c88a6f4232efe0642b49a04df12f6a0343865 --- /dev/null +++ b/Ansible/retweets_followers.json @@ -0,0 +1,10 @@ +{ + "_id": "_design/retweets_followers", + "views": { + "retweets_followers": { + "reduce": "_stats", + "map": "function (doc) {\n if(doc.tags.length > 0) {\n for (var idx in doc.tags) {\n emit(\n [doc.region, doc.tags[idx]], \n [doc.retweet_count, doc.user.followers_count]\n )\n }\n }\n}" + } + }, + "language": "javascript" +} \ No newline at end of file diff --git a/Ansible/sports_by_city.json b/Ansible/sports_by_city.json new file mode 100644 index 0000000000000000000000000000000000000000..ba319a58e84998822484982df135249530936568 --- /dev/null +++ b/Ansible/sports_by_city.json @@ -0,0 +1,10 @@ +{ + "_id": "_design/sports_by_city", + "views": { + "sports_by_city": { + "reduce": "_count", + "map": "function (doc) {\n if(doc.tags.length > 0) {\n for (var idx in doc.tags) {\n emit([doc.region, doc.tags[idx]],1)\n }\n }\n}" + } + }, + "language": "javascript" +} \ No newline at end of file