copyright | lastupdated | ||
---|---|---|---|
|
2017-10-16 |
{:shortdesc: .shortdesc} {:new_window: target="_blank"} {:tip: .tip} {:pre: .pre} {:codeblock: .codeblock} {:screen: .screen} {:javascript: .ph data-hd-programlang='javascript'} {:java: .ph data-hd-programlang='java'} {:python: .ph data-hd-programlang='python'} {:swift: .ph data-hd-programlang='swift'}
How do I decide which document upload method to use? {: shortdesc}
- Use the API if you are integrating the upload of content with an existing application or creating your own custom upload mechanism.
- Use the {{site.data.keyword.discoveryshort}} tooling if you want to quickly upload locally accessible files. When uploading documents using the {{site.data.keyword.discoveryshort}} tooling, all documents should have a unique file name. If two files have the same name, the original will be overwritten when the newer version is uploaded. If you would prefer that documents with the same file name coexist in your collection, the Document ID needs to be specified. You can specify the Document ID if you upload documents using the API or the Data Crawler.
- Use the Data Crawler if you want to have a managed upload of a significant number of files, or you want to extract content from a supported repository (such as a DB2 database).
Consider the following when you are ready to add documents to your collection:
-
The maximum file size that can be uploaded to the {{site.data.keyword.discoveryshort}} service is 50MB.
-
The sample documents are not automatically added to the collection. You must add them if you want them as part of your collection.
-
When creating a collection, you select the document language: English, Spanish, or German (English is the default). Your documents will be enriched in the selected language. Do not mix languages within the same collection.
-
You can add Microsoft Word, PDF, HTML, and JSON documents to your collection.
-
The documents in your collection will be converted using the configuration file provided, which is named Default Configuration, unless you choose a different configuration file. For information about creating a configuration file, see Custom configuration.
-
When documents are uploaded to a data collection, they are converted and enriched using the configuration file chosen for that collection. If you decide later that you would like to switch a collection to a different configuration file, you can do that, but the documents that have already been uploaded will remain converted by the original configuration file. All documents uploaded after switching the configuration file will use the new configuration file. If you want the entire collection to use the new configuration, you will need to create a new collection, choose that new configuration file, and re-upload all the documents.
- Create a collection. See Preparing the service for your documents.
- Click on the collection to open it.
- Click the Upload documents button and start uploading your documents via drag and drop or browse.
Your documents are now enqueued to be converted and enriched. The time this takes will depend on the size of your collection. After it is indexed and enriched, the details of the Collection will be displayed in the Overview section.
- Created and Last updated dates (Click Use this collection in API to see the
collection_id
,configuration_id
, andenvironment_id
.) - Number of documents in your collection
- Configuration — The name of the configuration file used to convert this collection
- Errors and Warnings
See Getting started with the {{site.data.keyword.discoveryshort}} API for a step-by-step tutorial.
For more information about the API, see the API reference {: new_window}.
- Use the
POST /v1/environments/{environment_id}/collections
method to create a collection. - Then use the
POST /v1/environments/{environment_id}/collections/{collection_id}/documents
method to add documents to your collection.