#
# curl http://localhost:5985/ilog2/_design/inverse
{"_id":"_design/inverse","_rev":"2-6a8c0618ffca0cf9f1f44a1846ac8fed","language":"javascript","views":{"dt":{"map":"function(doc) {\n  emit([parseInt(doc.datetime.substr(0,4),10),\n        parseInt(doc.datetime.substr(5,2),10),\n        parseInt(doc.datetime.substr(8,2),10),\n        parseInt(doc.datetime.substr(11,2),10),\n        parseInt(doc.datetime.substr(14,2),10)\n     ], null)\n}"}}}


#
# curl http://localhost:5985/ilog2/_design/select
{"_id":"_design/select","_rev":"4-6ec1dad5ef61e8c71ba3912a22a7b8b0","language":"javascript","views":{"extref":{"map":"function(doc) {\n  if (doc.referer && doc.referer!='-') {\n    if (! (doc.referer.match(/irekia.euskadi.net/) ||\n           doc.referer.match(/irekia.net/) ||\n           doc.referer.match(/irekia.org/) ||\n           doc.referer.match(/irekia.eu/) ||\n           doc.referer.match(/irekia.es/) )) {\n     emit([parseInt(doc.datetime.substr(0,4),10),\n        parseInt(doc.datetime.substr(5,2),10),\n        parseInt(doc.datetime.substr(8,2),10),\n        parseInt(doc.datetime.substr(11,2),10),\n        parseInt(doc.datetime.substr(14,2),10)\n     ], doc.referer)\n    }\n  }\n}"}}}


#
# curl http://localhost:5985/ilog3/_design/counter
{"_id":"_design/counter","_rev":"8-5f898457e71fa68f15ba8f171c880a3d","language":"javascript","views":{"ips":{"map":"function(doc) {\n  emit([parseInt(doc.datetime.substr(0,4),10),\n        parseInt(doc.datetime.substr(5,2),10),\n        parseInt(doc.datetime.substr(8,2),10),\n        parseInt(doc.datetime.substr(11,2),10),\n        parseInt(doc.datetime.substr(14,2),10),\n        doc.ip\n     ], 1)\n}","reduce":"function(path, flag) {\n  return sum(flag);\n}"},"pages":{"map":"function(doc) {\n  if (doc.path) {\n    ucir=/^\\/e.\\/(news|events|cat|web_tv|pages|albums|site)\\/.*/;\n    ucam=/^\\/e.\\/ma\\/(news|events|cat)\\/.*/;\n    if (doc.path.match(ucir) || doc.path.match(ucam)) {\n      emit([parseInt(doc.datetime.substr(0,4),10),\n        parseInt(doc.datetime.substr(5,2),10),\n        parseInt(doc.datetime.substr(8,2),10),\n        parseInt(doc.datetime.substr(11,2),10),\n        doc.path\n      ], 1);\n    }\n  }\n}","reduce":"function(path, flag) {\n  return sum(flag);\n}"},"videos":{"map":"function(doc) {\n  if (doc.path) {\n    if (doc.host === \"video\") {\n      ucir=/^\\/e.\\/(news|events|cat|web_tv|pages|albums|site)\\/.*/;\n      ucam=/^\\/e.\\/ma\\/(news|events|cat)\\/.*/;\n      isflv=/.*\\.flv/;\n      if (doc.path.match(isflv)) {\n         emit([parseInt(doc.datetime.substr(0,4),10),\n         parseInt(doc.datetime.substr(5,2),10),\n         parseInt(doc.datetime.substr(8,2),10),\n         parseInt(doc.datetime.substr(11,2),10),\n         doc.path.replace(/\\?start=.+/,\"\") ], 1);\n      }\n    }\n  }\n}","reduce":"function(path, flag) {\n  return sum(flag);\n\n}"},"rsss":{"map":"function(doc) {\n  if (doc.path) {\n      isrss=/.*\\.rss/;\n      if (doc.path.match(isrss)) {\n         emit([parseInt(doc.datetime.substr(0,4),10),\n         parseInt(doc.datetime.substr(5,2),10),\n         parseInt(doc.datetime.substr(8,2),10),\n         parseInt(doc.datetime.substr(11,2),10),\n         doc.path\n         ],1);\n      }\n   }\n}\n","reduce":"function(path, flag) {\n  return sum(flag);\n}\n"},"videoshq":{"map":"function(doc) {\n  if (doc.path) {\n    if (doc.host === \"video\") {\n      ismpg=/.*\\.mpg/;\n      ismpeg=/.*\\.mpeg/;\n      if (doc.path.match(ismpg) || doc.path.match(ismpeg)) {\n         emit([parseInt(doc.datetime.substr(0,4),10),\n         parseInt(doc.datetime.substr(5,2),10),\n         parseInt(doc.datetime.substr(8,2),10),\n         parseInt(doc.datetime.substr(11,2),10),\n         doc.path ], 1);\n      }\n    }\n  }\n}","reduce":"function(path, flag) {\n  return sum(flag);\n}"}}}
