简体   繁体   中英

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. In the documentation, there is explicitly said that we can process up to 50Mb JSON data with the API.

Where the issue might come from? (The JSON has a root array element and each of the objects contain only two Strings)

UPDATE: The JSON file has the following structure

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

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

413: Too large. 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 -

metadata string The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 MB are rejected.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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