--- Revision None +++ Revision 643961363339 @@ -0,0 +1,35 @@ +example document: + +{ + "_id": "2286-1996-08-20", + "_rev": "2-4aa5b6393c663ae3794efd67b9bbbd87", + "title": "A title", + "text": "This is an example", + "tokens": [ + "This", + "is", + "an", + "example" + ] +} + +map:function(doc) { + if ("tokens" in doc) { + for (var i in doc.tokens) { + emit(doc.tokens[i], doc._id); + } + } +} + +reduce:function(keys, values) { + var docs = []; + for (var i = 0; i < values.length; ++i) { + docs.push(values[i]); + } + return docs; +} + +error msg: +Error: reduce_overflow_error + +Reduce output must shrink more rapidly: Current output: '[["2650-1996-08-20","2650-1996-08-20","2650-1996-08-20","2650-1996-08-20","2650-1996-08-20","2650-19'... (first 100 of 849 bytes)