1

细节:

  • Apache CouchDB v. 3.1.1
  • 大约 5 GB 的 Twitter 数据已转储到分区中

我写的 Map reduce 函数:

{
 "_id": "_design/Info",
 "_rev": "13-c943aaf3b77b970f4e787be600dd240e",
 "views": {
   "trial-view": {
     "map": "function (doc) {\n  emit(doc.account_name, 1);\n}",
     "reduce": "_count"
   }
 },
 "language": "javascript",
 "options": {
   "partitioned": true
 }
}

当我在邮递员中尝试以下命令时:

http://<server_ip>:5984/mydb/_partition/partition1/_design/Info/_view/trial-view?key="BT"&group=true

我收到以下错误:

{
    "error": "timeout",
    "reason": "The request could not be processed in a reasonable amount of time."
}

请帮助我如何在如此庞大的数据上应用 mapReduce?

4

1 回答 1

0

所以,在意识到自己的错误之后,我想到了回答我自己的问题。答案很简单。它只是需要更多时间,因为索引需要很多时间。您可以查看元数据以查看正在索引的数据库数据。

于 2021-05-13T14:18:01.737 回答