简体   繁体   English

Watson Discovery:通过 API 处理数据时出现问题

[英]Watson Discovery: Problem with processing data through the API

I'm trying to process 30Mb JSON file to Watson Discovery with the Node SDK , but it gives the error that the file is too large.我正在尝试使用Node SDK30Mb JSON文件处理到Watson Discovery ,但它给出了文件太大的错误。 In the documentation, there is explicitly said that we can process up to 50Mb JSON data with the API.在文档中,明确表示我们可以使用 API 处理高达50Mb 的 JSON数据。

Where the issue might come from?问题可能来自哪里? (The JSON has a root array element and each of the objects contain only two Strings) (JSON 有一个根数组元素,每个对象只包含两个字符串)

UPDATE: The JSON file has the following structure更新: JSON 文件具有以下结构

{
  "elements":[
    {
       "Q":" ... ",
       "A":" ... "
    },
    ...
  ]
}

From the API Documentation - https://cloud.ibm.com/apidocs/discovery-data#adddocument来自 API 文档 - https://cloud.ibm.com/apidocs/discovery-data#adddocument

413: Too large. 413:太大。 Returned if you attempt to add a document or document metadata that exceeds the maximum possible.如果您尝试添加超过最大可能的文档或文档元数据,则返回。

So either the document or metadata is too large.所以文档或元数据都太大了。 Your data shouldn't be, so that leaves metadata.您的数据不应该是这样,因此会留下元数据。 Again from the API Documentation -再次来自 API 文档 -

metadata string The maximum supported metadata file size is 1 MB. metadata string 支持的最大元数据文件大小为 1 MB。 Metadata parts larger than 1 MB are rejected.大于 1 MB 的元数据部分将被拒绝。

Example: { "Creator": "Johnny Appleseed", "Subject": "Apples" }示例:{ "Creator": "Johnny Appleseed", "Subject": "Apples" }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM