Class ZCL_IBMC_DISCOVERY_V2

public inheriting from zcl_ibmc_service_ext create public

Documentation

Discovery v2

IBM Watson® Discovery is a cognitive search and content analytics engine that you can add to applications to identify patterns, trends and actionable insights to drive better decision-making. Securely unify structured and unstructured data with pre-enriched content, and use a simplified query language to eliminate the need for manual filtering of results.

Types

Visibility and LevelNameDocumentation
publict_analyzed_document (structured type)

An object that contains the converted document and any

identified enrichments. Root-level fields from the original file are returned also.
publict_analyzed_result (structured type)

Result of the document analysis.

publict_classifier_federated_model (structured type)

An object with details for creating federated document

classifier models.
publict_classifier_model_evaluation (structured type)

An object that contains information about a trained document

classifier model.
publict_cllctn_dtls_smrt_doc_undrst1 (structured type)

An object that describes the Smart Document Understanding

model for a collection.
publict_cmpnnt_settings_fields_shown (structured type)

Fields shown in the results section of the UI.

publict_cmpnnt_sttngs_flds_shwn_body (structured type)

Body label.

publict_cmpnnt_sttngs_flds_shwn_ttl (structured type)

Title label.

publict_collection (structured type)

A collection for storing documents.

publict_collection_details (structured type)

A collection for storing documents.

publict_collection_enrichment (structured type)

An object describing an enrichment for a collection.

publict_completions (structured type)

An object that contains an array of autocompletion

suggestions.
publict_component_settings_aggr (structured type)

Display settings for aggregations.

publict_component_settings_response (structured type)

The default component settings for this project.

publict_create_document_classifier (structured type)

An object that manages the settings and data that is

required to train a document classification model.
publict_create_enrichment (structured type)

Information about a specific enrichment.

publict_curated_results (structured type)

Object that contains an array of curated results.

publict_curation (structured type)

Curated query and responses.

publict_curations (structured type)

Array of queries with curated responses for the specified

project.
publict_curation_result (structured type)

Result information for a curated query.

publict_curation_status (structured type)

Curation status information.

publict_default_query_params (structured type)

Default query parameters for this project.

publict_delete_document_response (structured type)

Information returned when a document is deleted.

publict_dflt_qry_params_tab_results (structured type)

Default project query settings for table results.

publict_dflt_qry_prms_sggstd_rfnmnts (structured type)

Object that contains suggested refinement settings.



**Note**: The `suggested_refinements` parameter that identified dynamic facets from the data is deprecated.
publict_dflt_query_params_passages (structured type)

Default settings configuration for passage search options.

publict_document_accepted (structured type)

Information returned after an uploaded document is accepted.

publict_document_attribute (structured type)

List of document attributes.

publict_document_classifier (structured type)

Information about a document classifier.

publict_document_classifiers (structured type)

An object that contains a list of document classifier

definitions.
publict_document_classifier_model (structured type)

Information about a document classifier model.

publict_document_classifier_models (structured type)

An object that contains a list of document classifier model

definitions.
publict_document_details (structured type)

Information about a document.

publict_document_details_children (structured type)

Information about the child documents that are generated

from a single document during ingestion or other processing.
publict_doc_classifier_enrichment (structured type)

An object that describes enrichments that are applied to the

training and test data that is used by the document classifier.
publict_doc_classifier_model_train (structured type)

An object that contains configuration settings for a

document classifier model training run.
publict_enrichment (structured type)

Information about a specific enrichment.

publict_enrichments (structured type)

An object that contains an array of enrichment definitions.

publict_enrichment_options (structured type)

An object that contains options for the current enrichment.

Starting with version `2020-08-30`, the enrichment options are not included in responses from the List Enrichments method.
publict_error_response (structured type)

Error response information.

publict_expansion (structured type)

An expansion definition. Each object respresents one set of

expandable strings. For example, you could have expansions for the word `hot` in one object, and expansions for the word `cold` in another. Follow these guidelines when you add terms:

* Specify the terms in lowercase. Lowercase terms expand to uppercase.

* Multiword terms are supported only in bidirectional expansions.

* Do not specify a term that is specified in the stop words list for the collection.
publict_expansions (structured type)

The query expansion definitions for the specified

collection.
publict_field (structured type)

Object that contains field details.

publict_list_collections_response (structured type)

Response object that contains an array of collection

details.
publict_list_documents_response (structured type)

Response object that contains an array of documents.

publict_list_fields_response (structured type)

The list of fetched fields.



The fields are returned using a fully qualified name format, however, the format differs slightly from that used by the query operations.

* Fields which contain nested objects are assigned a type of "nested".

* Fields which belong to a nested object are prefixed with `.properties` (for example, `warnings.properties.severity` means that the `warnings` object has a property called `severity`).
publict_list_projects_response (structured type)

A list of projects in this instance.

publict_mdl_evaluation_macro_average (structured type)

A macro-average computes metric independently for each class

and then takes the average. Class refers to the classification label that is specified in the **answer_field**.
publict_mdl_evaluation_micro_average (structured type)

A micro-average aggregates the contributions of all classes

to compute the average metric. Classes refers to the classification labels that are specified in the **answer_field**.
publict_notice (structured type)

A notice produced for the collection.

publict_per_class_model_evaluation (structured type)

An object that measures the metrics from a training run for

each classification label separately.
publict_prjct_lst_dtls_rlvncy_trnng1 (structured type)

Relevancy training status information for this project.

publict_project_creation (structured type)

Detailed information about the specified project.

publict_project_creation_details (structured type)

Details about a specific project.

publict_project_details (structured type)

Detailed information about the specified project.

publict_project_list_details (structured type)

Details about a specific project.

publict_project_name (structured type)

Object that contains a new name for the specified project.

publict_project_rel_train_status (structured type)

Relevancy training status information for this project.

publict_qry_aggr_qry_clcltn_aggr (structured type)

Returns a scalar calculation across all documents for the

field specified. Possible calculations include min, max, sum, average, and unique_count.
publict_qry_aggr_qry_histogram_aggr (structured type)

Numeric interval segments to categorize documents by using

field values from a single numeric field to describe the category.
publict_qry_aggr_qry_timeslice_aggr (structured type)

A specialized histogram aggregation that uses dates to

create interval segments.
publict_qry_aggr_query_group_by_aggr (structured type)

Separates document results into groups that meet the

conditions you specify.
publict_qry_aggr_query_top_hits_aggr (structured type)

Returns the top documents ranked by the score of the query.

publict_qry_lrg_sggstd_refinements (structured type)

Configuration for suggested refinements.



**Note**: The **suggested_refinements** parameter that identified dynamic facets from the data is deprecated.
publict_query_aggregation type jsonobject

An object that defines how to aggregate query results.

publict_query_aggr_query_filter_aggr (structured type)

A modifier that narrows the document set of the

subaggregations it precedes.
publict_query_aggr_query_nested_aggr (structured type)

A restriction that alters the document set that is used by

the aggregations that it precedes. Subsequent aggregations are applied to nested documents from the specified field.
publict_query_aggr_query_pair_aggr (structured type)

Calculates relevancy values using combinations of document

sets from results of the specified pair of aggregations.
publict_query_aggr_query_term_aggr (structured type)

Returns results from the field that is specified.

publict_query_aggr_query_topic_aggr (structured type)

Detects how much the frequency of a given facet value

deviates from the expected average for the given time period. This aggregation type does not use data from previous time periods. It calculates an index by using the averages of frequency counts of other facet values for the given time period.
publict_query_aggr_query_trend_aggr (structured type)

Detects sharp and unexpected changes in the frequency of a

facet or facet value over time based on the past history of frequency changes of the facet value.
publict_query_calculation_aggr (structured type)

Returns a scalar calculation across all documents for the

field specified. Possible calculations include min, max, sum, average, and unique_count.
publict_query_filter_aggregation (structured type)

A modifier that narrows the document set of the

subaggregations it precedes.
publict_query_group_by_aggregation (structured type)

Separates document results into groups that meet the

conditions you specify.
publict_query_group_by_aggr_result (structured type)

Result group for the `group_by` aggregation.

publict_query_histogram_aggregation (structured type)

Numeric interval segments to categorize documents by using

field values from a single numeric field to describe the category.
publict_query_histogram_aggr_result (structured type)

Histogram numeric interval result.

publict_query_large (structured type)

Object that describes a long query.

publict_query_large_passages (structured type)

Configuration for passage retrieval.

publict_query_large_similar (structured type)

Finds results from documents that are similar to documents

of interest. Use this parameter to add a *More like these* function to your search. You can include this parameter with or without a **query**, **filter** or **natural_language_query** parameter.
publict_query_large_table_results (structured type)

Configuration for table retrieval.

publict_query_nested_aggregation (structured type)

A restriction that alters the document set that is used by

the aggregations that it precedes. Subsequent aggregations are applied to nested documents from the specified field.
publict_query_notices_response (structured type)

Object that contains notice query results.

publict_query_pair_aggregation (structured type)

Calculates relevancy values using combinations of document

sets from results of the specified pair of aggregations.
publict_query_pair_aggr_result (structured type)

Result for the `pair` aggregation.

publict_query_response (structured type)

A response that contains the documents and aggregations for

the query.
publict_query_response_passage (structured type)

A passage query response.

publict_query_result (structured type)

Result document for the specified query.

publict_query_result_metadata (structured type)

Metadata of a query result.

publict_query_result_passage (structured type)

A passage query result.

publict_query_sub_aggregation type jsonobject

Aggregation results. For more information about supported

aggregation types, see the [product documentation](/docs/discovery-data?topic=discovery-data-query-aggregations).
publict_query_suggested_refinement (structured type)

A suggested additional query term or terms user to filter

results. **Note**: The `suggested_refinements` parameter is deprecated.
publict_query_table_result (structured type)

A tables whose content or context match a search query.

publict_query_term_aggregation (structured type)

Returns results from the field that is specified.

publict_query_term_aggr_result (structured type)

Top value result for the `term` aggregation.

publict_query_timeslice_aggregation (structured type)

A specialized histogram aggregation that uses dates to

create interval segments.
publict_query_timeslice_aggr_result (structured type)

A timeslice interval segment.

publict_query_topic_aggregation (structured type)

Detects how much the frequency of a given facet value

deviates from the expected average for the given time period. This aggregation type does not use data from previous time periods. It calculates an index by using the averages of frequency counts of other facet values for the given time period.
publict_query_topic_aggr_result (structured type)

Result for the `topic` aggregation.

publict_query_top_hits_aggregation (structured type)

Returns the top documents ranked by the score of the query.

publict_query_top_hits_aggr_result (structured type)

A query response that contains the matching documents for

the preceding aggregations.
publict_query_trend_aggregation (structured type)

Detects sharp and unexpected changes in the frequency of a

facet or facet value over time based on the past history of frequency changes of the facet value.
publict_query_trend_aggr_result (structured type)

Result for the `trend` aggregation.

publict_result_passage_answer (structured type)

Object that contains a potential answer to the specified

query.
publict_retrieval_details (structured type)

An object contain retrieval type information.

publict_stop_word_list (structured type)

List of words to filter out of text that is submitted in

queries.
publict_table_body_cells (structured type)

Cells that are not table header, column header, or row

header cells.
publict_table_cell_key (structured type)

A key in a key-value pair.

publict_table_cell_value type standard table of t_table_cell_values with non-unique default key

A list of values in a key-value pair.

publict_table_cell_values (structured type)

A value in a key-value pair.

publict_table_column_headers (structured type)

Column-level cells, each applicable as a header to other

cells in the same column as itself, of the current table.
publict_table_column_header_ids (structured type)

An array of values, each being the `id` value of a column

header that is applicable to the current cell.
publict_table_column_header_texts (structured type)

An array of values, each being the `text` value of a column

header that is applicable to the current cell.
publict_table_element_location (structured type)

The numeric location of the identified element in the

document, represented with two integers labeled `begin` and `end`.
publict_table_headers (structured type)

The contents of the current table's header.

publict_table_key_value_pairs (structured type)

Key-value pairs detected across cell boundaries.

publict_table_result_table (structured type)

Full table object retrieved from Table Understanding

Enrichment.
publict_table_row_headers (structured type)

Row-level cells, each applicable as a header to other cells

in the same row as itself, of the current table.
publict_table_row_header_ids (structured type)

An array of values, each being the `id` value of a row

header that is applicable to this body cell.
publict_table_row_header_texts (structured type)

An array of values, each being the `text` value of a row

header that is applicable to this body cell.
publict_table_text_location (structured type)

Text and associated location within a table.

publict_tab_column_header_texts_norm (structured type)

If you provide customization input, the normalized version

of the column header texts according to the customization; otherwise, the same value as `column_header_texts`.
publict_tab_row_header_texts_norm (structured type)

If you provide customization input, the normalized version

of the row header texts according to the customization; otherwise, the same value as `row_header_texts`.
publict_training_example (structured type)

Object that contains example response details for a training

query.
publict_training_query (structured type)

Object that contains training query details.

publict_training_query_set (structured type)

Object specifying the training queries contained in the

identified training set.
publict_update_collection (structured type)

An object that represents the collection to be updated.

publict_update_document_classifier (structured type)

An object that contains a new name or description for a

document classifier, updated training data, or new or updated test data.
publict_update_enrichment (structured type)

An object that contains a new name and description for an

enrichment.
publict_upd_doc_classifier_model (structured type)

An object that contains a new name or description for a

document classifier model.

Constants

Visibility and LevelNameDocumentation
public staticc_abapname_dictionary (structured type)

Map ABAP identifiers to service identifiers.

public staticc_required_fields (structured type)

List of required fields per type.

Methods

Visibility and LevelNameDocumentation
public instance
add_document
importingi_project_idtype string
i_collection_idtype string
i_filetype file optional
i_filenametype string optional
i_file_content_typetype string optional
i_metadatatype string optional
i_x_watson_discovery_forcetype boolean default c_boolean_false
i_contenttypetype string default 'multipart/form-data'
i_accepttype string default 'application/json'
exportinge_responsetype t_document_accepted
raisingzcx_ibmc_service_exception

Add a document

Add a document to a collection with optional metadata.

Returns immediately after the system has accepted the document for processing.

Use this method to upload a file to the collection. You cannot use this method to crawl an external data source.

* For a list of supported file types, see the [product documentation](/docs/discovery-data?topic=discovery-data-collections#supportedf iletypes).

* You must provide document content, metadata, or both. If the request is missing both document content and metadata, it is rejected.

* You can set the **Content-Type** parameter on the **file** part to indicate the media type of the document. If the **Content-Type** parameter is missing or is one of the generic media types (for example, `application/octet-stream`), then the service attempts to automatically detect the document's media type.

* If the document is uploaded to a collection that shares its data with another collection, the **X-Watson-Discovery-Force** header must be set to `true`.

* In curl requests only, you can assign an ID to a document that you add by appending the ID to the endpoint (`/v2/projects/{project_id}/collections/{collection_id}/doc uments/{document_id}`). If a document already exists with the specified ID, it is replaced.

For more information about how certain file types and field names are handled when a file is added to a collection, see the [product documentation](/docs/discovery-data?topic=discovery-data-index-overview#field-n ame-limits).
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_collection_id The ID of the collection.
i_file When adding a document, the content of the document to ingest. For maximum supported file size limits, see [the documentation](/docs/discovery-data?topic=discovery-data-collections#collection s-doc-limits).

When analyzing a document, the content of the document to analyze but not ingest. Only the `application/json` content type is supported currently. For maximum supported file size limits, see [the product documentation](/docs/discovery-data?topic=discovery-data-analyzeapi#analyzeapi- limits).
i_filename The filename for file.
i_file_content_type The content type of file.
i_metadata Add information about the file that you want to include in the response.

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

Example:

```
{
"filename": "favorites2.json",
"file_type": "json"
}.
i_x_watson_discovery_force When `true`, the uploaded document is added to the collection even if the data for that collection is shared with other collections.
e_response Service return value of type T_DOCUMENT_ACCEPTED
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
analyze_document
importingi_project_idtype string
i_collection_idtype string
i_filetype file optional
i_filenametype string optional
i_file_content_typetype string optional
i_metadatatype string optional
i_contenttypetype string default 'multipart/form-data'
i_accepttype string default 'application/json'
exportinge_responsetype t_analyzed_document
raisingzcx_ibmc_service_exception

Analyze a Document

Process a document and return it for realtime use. Supports JSON files only.

The file is not stored in the collection, but is processed according to the collection's configuration settings. To get results, enrichments must be applied to a field in the collection that also exists in the file that you want to analyze. For example, to analyze text in a `Quote` field, you must apply enrichments to the `Quote` field in the collection configuration. Then, when you analyze the file, the text in the `Quote` field is analyzed and results are written to a field named `enriched_Quote`.

**Note:** This method is supported with Enterprise plan deployments and installed deployments only.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_collection_id The ID of the collection.
i_file When adding a document, the content of the document to ingest. For maximum supported file size limits, see [the documentation](/docs/discovery-data?topic=discovery-data-collections#collection s-doc-limits).

When analyzing a document, the content of the document to analyze but not ingest. Only the `application/json` content type is supported currently. For maximum supported file size limits, see [the product documentation](/docs/discovery-data?topic=discovery-data-analyzeapi#analyzeapi- limits).
i_filename The filename for file.
i_file_content_type The content type of file.
i_metadata Add information about the file that you want to include in the response.

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

Example:

```
{
"filename": "favorites2.json",
"file_type": "json"
}.
e_response Service return value of type T_ANALYZED_DOCUMENT
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
create_collection
importingi_project_idtype string
i_collectiondetailstype t_collection_details
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_collection_details
raisingzcx_ibmc_service_exception

Create a collection

Create a new collection in the specified project.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_collectiondetails An object that represents the collection to be created.
e_response Service return value of type T_COLLECTION_DETAILS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
create_document_classifier
importingi_project_idtype string
i_training_datatype file
i_classifiertype t_create_document_classifier
i_test_datatype file optional
i_training_data_cttype string default zif_ibmc_service_arch~c_mediatype-all
i_test_data_cttype string default zif_ibmc_service_arch~c_mediatype-all
i_contenttypetype string default 'multipart/form-data'
i_accepttype string default 'application/json'
exportinge_responsetype t_document_classifier
raisingzcx_ibmc_service_exception

Create a document classifier

Create a document classifier. You can use the API to create a document classifier in any project type. After you create a document classifier, you can use the Enrichments API to create a classifier enrichment, and then the Collections API to apply the enrichment to a collection in the project.

**Note:** This method is supported on installed instances (IBM Cloud Pak for Data) or IBM Cloud-managed Premium or Enterprise plan instances.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_training_data The training data CSV file to upload. The CSV file must have headers. The file must include a field that contains the text you want to classify and a field that contains the classification labels that you want to use to classify your data. If you want to specify multiple values in a single field, use a semicolon as the value separator. For a sample file, see [the product documentation](/docs/discovery-data?topic=discovery-data-cm-doc-classifier).
i_classifier An object that manages the settings and data that is required to train a document classification model.
i_test_data The CSV with test data to upload. The column values in the test file must be the same as the column values in the training data file. If no test data is provided, the training data is split into two separate groups of training and test data.
e_response Service return value of type T_DOCUMENT_CLASSIFIER
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
create_enrichment
importingi_project_idtype string
i_enrichmenttype t_create_enrichment
i_filetype file optional
i_file_cttype string default zif_ibmc_service_arch~c_mediatype-all
i_contenttypetype string default 'multipart/form-data'
i_accepttype string default 'application/json'
exportinge_responsetype t_enrichment
raisingzcx_ibmc_service_exception

Create an enrichment

Create an enrichment for use with the specified project. To apply the enrichment to a collection in the project, use the [Collections API](/apidocs/discovery-data#createcollection).
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_enrichment Information about a specific enrichment.
i_file The enrichment file to upload. Expected file types per enrichment are as follows:

* CSV for `dictionary`

* PEAR for `uima_annotator` and `rule_based` (Explorer)

* ZIP for `watson_knowledge_studio_model` and `rule_based` (Studio Advanced Rule Editor).
e_response Service return value of type T_ENRICHMENT
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
create_expansions
importingi_project_idtype string
i_collection_idtype string
i_bodytype t_expansions
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_expansions
raisingzcx_ibmc_service_exception

Create or update an expansion list

Creates or replaces the expansion list for this collection. An expansion list introduces alternative wording for key terms that are mentioned in your collection. By identifying synonyms or common misspellings, you expand the scope of a query beyond exact matches. The maximum number of expanded terms allowed per collection is 5,000.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_collection_id The ID of the collection.
i_body An object that defines the expansion list.
e_response Service return value of type T_EXPANSIONS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
create_project
importingi_projectcreationtype t_project_creation
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_project_details
raisingzcx_ibmc_service_exception

Create a project

Create a new project for this instance
Parameters
i_projectcreation An object that represents the project to be created.
e_response Service return value of type T_PROJECT_DETAILS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
create_stopword_list
importingi_project_idtype string
i_collection_idtype string
i_stopwordlisttype t_stop_word_list optional
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_stop_word_list
raisingzcx_ibmc_service_exception

Create a custom stop words list

Adds a list of custom stop words. Stop words are words that you want the service to ignore when they occur in a query because they're not useful in distinguishing the semantic meaning of the query. The stop words list cannot contain more than 1 million characters.

A default stop words list is used by all collections. The default list is applied both at indexing time and at query time. A custom stop words list that you add is used at query time only.

The custom stop words list augments the default stop words list; you cannot remove stop words. For information about the default stop words lists per language, see [the product documentation](/docs/discovery-data?topic=discovery-data-stopwords).
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_collection_id The ID of the collection.
i_stopwordlist No documentation available.
e_response Service return value of type T_STOP_WORD_LIST
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
create_training_query
importingi_project_idtype string
i_trainingquerytype t_training_query
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_training_query
raisingzcx_ibmc_service_exception

Create training query

Add a query to the training data for this project. The query can contain a filter and natural language query.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_trainingquery An object that represents the query to be submitted. At least 50 queries are required for training to begin. A maximum of 10,000 queries are allowed.
e_response Service return value of type T_TRAINING_QUERY
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
cre_document_classifier_model
importingi_project_idtype string
i_classifier_idtype string
i_documentclassifiermodeltraintype t_doc_classifier_model_train
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_document_classifier_model
raisingzcx_ibmc_service_exception

Create a document classifier model

Create a document classifier model by training a model that uses the data and classifier settings defined in the specified document classifier.

**Note:** This method is supported on installed intances (IBM Cloud Pak for Data) or IBM Cloud-managed Premium or Enterprise plan instances.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_classifier_id The ID of the classifier.
i_documentclassifiermodeltrain An object that contains the training configuration information for the document classifier to be trained.
e_response Service return value of type T_DOCUMENT_CLASSIFIER_MODEL
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
delete_collection
importingi_project_idtype string
i_collection_idtype string
raisingzcx_ibmc_service_exception

Delete a collection

Deletes the specified collection from the project. All documents stored in the specified collection and not shared is also deleted.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_collection_id The ID of the collection.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
delete_document
importingi_project_idtype string
i_collection_idtype string
i_document_idtype string
i_x_watson_discovery_forcetype boolean default c_boolean_false
i_accepttype string default 'application/json'
exportinge_responsetype t_delete_document_response
raisingzcx_ibmc_service_exception

Delete a document

Deletes the document with the document ID that you specify from the collection. Removes uploaded documents from the collection permanently. If you delete a document that was added by crawling an external data source, the document will be added again with the next scheduled crawl of the data source. The delete function removes the document from the collection, not from the external data source.

**Note:** Files such as CSV or JSON files generate subdocuments when they are added to a collection. If you delete a subdocument, and then repeat the action that created it, the deleted document is added back in to your collection. To remove subdocuments that are generated by an uploaded file, delete the original document instead. You can get the document ID of the original document from the `parent_document_id` of the subdocument result.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_collection_id The ID of the collection.
i_document_id The ID of the document.
i_x_watson_discovery_force When `true`, the uploaded document is added to the collection even if the data for that collection is shared with other collections.
e_response Service return value of type T_DELETE_DOCUMENT_RESPONSE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
delete_document_classifier
importingi_project_idtype string
i_classifier_idtype string
raisingzcx_ibmc_service_exception

Delete a document classifier

Deletes an existing document classifier from the specified project.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_classifier_id The ID of the classifier.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
delete_enrichment
importingi_project_idtype string
i_enrichment_idtype string
raisingzcx_ibmc_service_exception

Delete an enrichment

Deletes an existing enrichment from the specified project.

**Note:** Only enrichments that have been manually created can be deleted.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_enrichment_id The ID of the enrichment.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
delete_expansions
importingi_project_idtype string
i_collection_idtype string
raisingzcx_ibmc_service_exception

Delete the expansion list

Removes the expansion information for this collection. To disable query expansion for a collection, delete the expansion list.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_collection_id The ID of the collection.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
delete_project
importingi_project_idtype string
raisingzcx_ibmc_service_exception

Delete a project

Deletes the specified project.

**Important:** Deleting a project deletes everything that is part of the specified project, including all collections.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
delete_stopword_list
importingi_project_idtype string
i_collection_idtype string
raisingzcx_ibmc_service_exception

Delete a custom stop words list

Deletes a custom stop words list to stop using it in queries against the collection. After a custom stop words list is deleted, the default stop words list is used.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_collection_id The ID of the collection.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
delete_training_queries
importingi_project_idtype string
raisingzcx_ibmc_service_exception

Delete training queries

Removes all training queries for the specified project.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
delete_training_query
importingi_project_idtype string
i_query_idtype string
raisingzcx_ibmc_service_exception

Delete a training data query

Removes details from a training data query, including the query string and all examples.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_query_id The ID of the query used for training.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
delete_user_data
importingi_customer_idtype string
raisingzcx_ibmc_service_exception

Delete labeled data

Deletes all data associated with a specified customer ID. The method has no effect if no data is associated with the customer ID.

You associate a customer ID with data by passing the **X-Watson-Metadata** header with a request that passes data. For more information about personal data and customer IDs, see [Information security](/docs/discovery-data?topic=discovery-data-information-security#inform ation-security).

**Note:** This method is only supported on IBM Cloud instances of Discovery.
Parameters
i_customer_id The customer ID for which all data is to be deleted.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
del_document_classifier_model
importingi_project_idtype string
i_classifier_idtype string
i_model_idtype string
raisingzcx_ibmc_service_exception

Delete a document classifier model

Deletes an existing document classifier model from the specified project.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_classifier_id The ID of the classifier.
i_model_id The ID of the classifier model.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instanceget_appname redefinition 
public instance
get_autocompletion
importingi_project_idtype string
i_prefixtype string
i_collection_idstype tt_string optional
i_fieldtype string optional
i_counttype integer default 5
i_accepttype string default 'application/json'
exportinge_responsetype t_completions
raisingzcx_ibmc_service_exception

Get Autocomplete Suggestions

Returns completion query suggestions for the specified prefix.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_prefix The prefix to use for autocompletion. For example, the prefix `Ho` could autocomplete to `hot`, `housing`, or `how`.
i_collection_ids Comma separated list of the collection IDs. If this parameter is not specified, all collections in the project are used.
i_field The field in the result documents that autocompletion suggestions are identified from.
i_count The number of autocompletion suggestions to return.
e_response Service return value of type T_COMPLETIONS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
get_collection
importingi_project_idtype string
i_collection_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_collection_details
raisingzcx_ibmc_service_exception

Get collection

Get details about the specified collection.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_collection_id The ID of the collection.
e_response Service return value of type T_COLLECTION_DETAILS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
get_component_settings
importingi_project_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_component_settings_response
raisingzcx_ibmc_service_exception

List component settings

Returns default configuration settings for components.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
e_response Service return value of type T_COMPONENT_SETTINGS_RESPONSE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
get_document
importingi_project_idtype string
i_collection_idtype string
i_document_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_document_details
raisingzcx_ibmc_service_exception

Get document details

Get details about a specific document, whether the document is added by uploading a file or by crawling an external data source.

**Note**: This method is available only from Cloud Pak for Data version 4.0.9 and later installed instances and from Plus and Enterprise plan IBM Cloud-managed instances. It is not currently available from Premium plan instances.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_collection_id The ID of the collection.
i_document_id The ID of the document.
e_response Service return value of type T_DOCUMENT_DETAILS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
get_document_classifier
importingi_project_idtype string
i_classifier_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_document_classifier
raisingzcx_ibmc_service_exception

Get a document classifier

Get details about a specific document classifier.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_classifier_id The ID of the classifier.
e_response Service return value of type T_DOCUMENT_CLASSIFIER
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
get_document_classifier_model
importingi_project_idtype string
i_classifier_idtype string
i_model_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_document_classifier_model
raisingzcx_ibmc_service_exception

Get a document classifier model

Get details about a specific document classifier model.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_classifier_id The ID of the classifier.
i_model_id The ID of the classifier model.
e_response Service return value of type T_DOCUMENT_CLASSIFIER_MODEL
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
get_enrichment
importingi_project_idtype string
i_enrichment_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_enrichment
raisingzcx_ibmc_service_exception

Get enrichment

Get details about a specific enrichment.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_enrichment_id The ID of the enrichment.
e_response Service return value of type T_ENRICHMENT
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
get_project
importingi_project_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_project_details
raisingzcx_ibmc_service_exception

Get project

Get details on the specified project.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
e_response Service return value of type T_PROJECT_DETAILS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instanceget_request_prop redefinition 
public instanceget_sdk_version_date redefinition 
public instance
get_stopword_list
importingi_project_idtype string
i_collection_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_stop_word_list
raisingzcx_ibmc_service_exception

Get a custom stop words list

Returns the custom stop words list that is used by the collection. For information about the default stop words lists that are applied to queries, see [the product documentation](/docs/discovery-data?topic=discovery-data-stopwords).
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_collection_id The ID of the collection.
e_response Service return value of type T_STOP_WORD_LIST
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
get_training_query
importingi_project_idtype string
i_query_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_training_query
raisingzcx_ibmc_service_exception

Get a training data query

Get details for a specific training data query, including the query string and all examples
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_query_id The ID of the query used for training.
e_response Service return value of type T_TRAINING_QUERY
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
list_collections
importingi_project_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_list_collections_response
raisingzcx_ibmc_service_exception

List collections

Lists existing collections for the specified project.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
e_response Service return value of type T_LIST_COLLECTIONS_RESPONSE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
list_documents
importingi_project_idtype string
i_collection_idtype string
i_counttype integer default 1000
i_statustype string optional
i_has_noticestype boolean optional
i_is_parenttype boolean optional
i_parent_document_idtype string optional
i_sha256type string optional
i_accepttype string default 'application/json'
exportinge_responsetype t_list_documents_response
raisingzcx_ibmc_service_exception

List documents

Lists the documents in the specified collection. The list includes only the document ID of each document and returns information for up to 10,000 documents.

**Note**: This method is available only from Cloud Pak for Data version 4.0.9 and later installed instances and from Plus and Enterprise plan IBM Cloud-managed instances. It is not currently available from Premium plan instances.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_collection_id The ID of the collection.
i_count The maximum number of documents to return. Up to 1,000 documents are returned by default. The maximum number allowed is 10,000.
i_status Filters the documents to include only documents with the specified ingestion status. The options include:

* `available`: Ingestion is finished and the document is indexed.

* `failed`: Ingestion is finished, but the document is not indexed because of an error.

* `pending`: The document is uploaded, but the ingestion process is not started.

* `processing`: Ingestion is in progress.

You can specify one status value or add a comma-separated list of more than one status value. For example, `available,failed`.
i_has_notices If set to `true`, only documents that have notices, meaning documents for which warnings or errors were generated during the ingestion, are returned. If set to `false`, only documents that don't have notices are returned. If unspecified, no filter based on notices is applied.

Notice details are not available in the result, but you can use the [Query collection notices](#querycollectionnotices) method to find details by adding the parameter `query=notices.document_id:{document-id}`.
i_is_parent If set to `true`, only parent documents, meaning documents that were split during the ingestion process and resulted in two or more child documents, are returned. If set to `false`, only child documents are returned. If unspecified, no filter based on the parent or child relationship is applied.

CSV files, for example, are split into separate documents per line and JSON files are split into separate documents per object.
i_parent_document_id Filters the documents to include only child documents that were generated when the specified parent document was processed.
i_sha256 Filters the documents to include only documents with the specified SHA-256 hash. Format the hash as a hexadecimal string.
e_response Service return value of type T_LIST_DOCUMENTS_RESPONSE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
list_document_classifiers
importingi_project_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_document_classifiers
raisingzcx_ibmc_service_exception

List document classifiers

Get a list of the document classifiers in a project. Returns only the name and classifier ID of each document classifier.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
e_response Service return value of type T_DOCUMENT_CLASSIFIERS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
list_enrichments
importingi_project_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_enrichments
raisingzcx_ibmc_service_exception

List enrichments

Lists the enrichments available to this project. The *Part of Speech* and *Sentiment of Phrases* enrichments might be listed, but are reserved for internal use only.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
e_response Service return value of type T_ENRICHMENTS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
list_expansions
importingi_project_idtype string
i_collection_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_expansions
raisingzcx_ibmc_service_exception

Get the expansion list

Returns the current expansion list for the specified collection. If an expansion list is not specified, an empty expansions array is returned.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_collection_id The ID of the collection.
e_response Service return value of type T_EXPANSIONS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
list_fields
importingi_project_idtype string
i_collection_idstype tt_string optional
i_accepttype string default 'application/json'
exportinge_responsetype t_list_fields_response
raisingzcx_ibmc_service_exception

List fields

Gets a list of the unique fields (and their types) stored in the specified collections.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_collection_ids Comma separated list of the collection IDs. If this parameter is not specified, all collections in the project are used.
e_response Service return value of type T_LIST_FIELDS_RESPONSE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
list_projects
importingi_accepttype string default 'application/json'
exportinge_responsetype t_list_projects_response
raisingzcx_ibmc_service_exception

List projects

Lists existing projects for this instance.
Parameters
e_response Service return value of type T_LIST_PROJECTS_RESPONSE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
list_training_queries
importingi_project_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_training_query_set
raisingzcx_ibmc_service_exception

List training queries

List the training queries for the specified project.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
e_response Service return value of type T_TRAINING_QUERY_SET
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
lst_document_classifier_models
importingi_project_idtype string
i_classifier_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_document_classifier_models
raisingzcx_ibmc_service_exception

List document classifier models

Get a list of the document classifier models in a project. Returns only the name and model ID of each document classifier model.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_classifier_id The ID of the classifier.
e_response Service return value of type T_DOCUMENT_CLASSIFIER_MODELS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
query
importingi_project_idtype string
i_query_longtype t_query_large optional
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_query_response
raisingzcx_ibmc_service_exception

Query a project

Search your data by submitting queries that are written in natural language or formatted in the Discovery Query Language. For more information, see the [Discovery documentation](/docs/discovery-data?topic=discovery-data-query-concepts). The default query parameters differ by project type. For more information about the project default settings, see the [Discovery documentation](/docs/discovery-data?topic=discovery-data-query-defaults). See [the Projects API documentation](#create-project) for details about how to set custom default query settings.

The length of the UTF-8 encoding of the POST body cannot exceed 10,000 bytes, which is roughly equivalent to 10,000 characters in English.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_query_long An object that represents the query to be submitted.
e_response Service return value of type T_QUERY_RESPONSE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
query_collection_notices
importingi_project_idtype string
i_collection_idtype string
i_filtertype string optional
i_querytype string optional
i_natural_language_querytype string optional
i_counttype integer default 10
i_offsettype integer optional
i_accepttype string default 'application/json'
exportinge_responsetype t_query_notices_response
raisingzcx_ibmc_service_exception

Query collection notices

Finds collection-level notices (errors and warnings) that are generated when documents are ingested.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_collection_id The ID of the collection.
i_filter Searches for documents that match the Discovery Query Language criteria that is specified as input. Filter calls are cached and are faster than query calls because the results are not ordered by relevance. When used with the `aggregation`, `query`, or `natural_language_query` parameters, the `filter` parameter runs first. This parameter is useful for limiting results to those that contain specific metadata values.
i_query A query search that is written in the Discovery Query Language and returns all matching documents in your data set with full enrichments and full text, and with the most relevant documents listed first.
i_natural_language_query A natural language query that returns relevant documents by using training data and natural language understanding.
i_count Number of results to return. The maximum for the **count** and **offset** values together in any one query is **10,000**.
i_offset The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the **count** and **offset** values together in any one query is **10000**.
e_response Service return value of type T_QUERY_NOTICES_RESPONSE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
query_notices
importingi_project_idtype string
i_filtertype string optional
i_querytype string optional
i_natural_language_querytype string optional
i_counttype integer default 10
i_offsettype integer optional
i_accepttype string default 'application/json'
exportinge_responsetype t_query_notices_response
raisingzcx_ibmc_service_exception

Query project notices

Finds project-level notices (errors and warnings). Currently, project-level notices are generated by relevancy training.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_filter Searches for documents that match the Discovery Query Language criteria that is specified as input. Filter calls are cached and are faster than query calls because the results are not ordered by relevance. When used with the `aggregation`, `query`, or `natural_language_query` parameters, the `filter` parameter runs first. This parameter is useful for limiting results to those that contain specific metadata values.
i_query A query search that is written in the Discovery Query Language and returns all matching documents in your data set with full enrichments and full text, and with the most relevant documents listed first.
i_natural_language_query A natural language query that returns relevant documents by using training data and natural language understanding.
i_count Number of results to return. The maximum for the **count** and **offset** values together in any one query is **10,000**.
i_offset The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the **count** and **offset** values together in any one query is **10000**.
e_response Service return value of type T_QUERY_NOTICES_RESPONSE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
update_collection
importingi_project_idtype string
i_collection_idtype string
i_updatecollectiontype t_update_collection
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_collection_details
raisingzcx_ibmc_service_exception

Update a collection

Updates the specified collection's name, description, and enrichments.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_collection_id The ID of the collection.
i_updatecollection An object that represents the collection to be updated.
e_response Service return value of type T_COLLECTION_DETAILS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
update_document
importingi_project_idtype string
i_collection_idtype string
i_document_idtype string
i_filetype file optional
i_filenametype string optional
i_file_content_typetype string optional
i_metadatatype string optional
i_x_watson_discovery_forcetype boolean default c_boolean_false
i_contenttypetype string default 'multipart/form-data'
i_accepttype string default 'application/json'
exportinge_responsetype t_document_accepted
raisingzcx_ibmc_service_exception

Update a document

Replace an existing document or add a document with a specified document ID. Starts ingesting a document with optional metadata.

Use this method to upload a file to a collection. You cannot use this method to crawl an external data source.

If the document is uploaded to a collection that shares its data with another collection, the **X-Watson-Discovery-Force** header must be set to `true`.

**Notes:**

* Uploading a new document with this method automatically replaces any existing document stored with the same document ID.

* If an uploaded document is split into child documents during ingestion, all existing child documents are overwritten, even if the updated version of the document has fewer child documents.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_collection_id The ID of the collection.
i_document_id The ID of the document.
i_file When adding a document, the content of the document to ingest. For maximum supported file size limits, see [the documentation](/docs/discovery-data?topic=discovery-data-collections#collection s-doc-limits).

When analyzing a document, the content of the document to analyze but not ingest. Only the `application/json` content type is supported currently. For maximum supported file size limits, see [the product documentation](/docs/discovery-data?topic=discovery-data-analyzeapi#analyzeapi- limits).
i_filename The filename for file.
i_file_content_type The content type of file.
i_metadata Add information about the file that you want to include in the response.

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

Example:

```
{
"filename": "favorites2.json",
"file_type": "json"
}.
i_x_watson_discovery_force When `true`, the uploaded document is added to the collection even if the data for that collection is shared with other collections.
e_response Service return value of type T_DOCUMENT_ACCEPTED
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
update_document_classifier
importingi_project_idtype string
i_classifier_idtype string
i_classifiertype t_update_document_classifier
i_training_datatype file optional
i_test_datatype file optional
i_training_data_cttype string default zif_ibmc_service_arch~c_mediatype-all
i_test_data_cttype string default zif_ibmc_service_arch~c_mediatype-all
i_contenttypetype string default 'multipart/form-data'
i_accepttype string default 'application/json'
exportinge_responsetype t_document_classifier
raisingzcx_ibmc_service_exception

Update a document classifier

Update the document classifier name or description, update the training data, or add or update the test data.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_classifier_id The ID of the classifier.
i_classifier An object that contains a new name or description for a document classifier, updated training data, or new or updated test data.
i_training_data The training data CSV file to upload. The CSV file must have headers. The file must include a field that contains the text you want to classify and a field that contains the classification labels that you want to use to classify your data. If you want to specify multiple values in a single column, use a semicolon as the value separator. For a sample file, see [the product documentation](/docs/discovery-data?topic=discovery-data-cm-doc-classifier).
i_test_data The CSV with test data to upload. The column values in the test file must be the same as the column values in the training data file. If no test data is provided, the training data is split into two separate groups of training and test data.
e_response Service return value of type T_DOCUMENT_CLASSIFIER
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
update_enrichment
importingi_project_idtype string
i_enrichment_idtype string
i_updateenrichmenttype t_update_enrichment
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_enrichment
raisingzcx_ibmc_service_exception

Update an enrichment

Updates an existing enrichment's name and description.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_enrichment_id The ID of the enrichment.
i_updateenrichment An object that lists the new name and description for an enrichment.
e_response Service return value of type T_ENRICHMENT
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
update_project
importingi_project_idtype string
i_projectnametype t_project_name optional
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_project_details
raisingzcx_ibmc_service_exception

Update a project

Update the specified project's name.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_projectname An object that represents the new name of the project.
e_response Service return value of type T_PROJECT_DETAILS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
update_training_query
importingi_project_idtype string
i_query_idtype string
i_bodytype t_training_query
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_training_query
raisingzcx_ibmc_service_exception

Update a training query

Updates an existing training query and it's examples.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_query_id The ID of the query used for training.
i_body The body of the example that is to be added to the specified query.
e_response Service return value of type T_TRAINING_QUERY
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.
public instance
upd_document_classifier_model
importingi_project_idtype string
i_classifier_idtype string
i_model_idtype string
i_updtdcmntclssfrmdltype t_upd_doc_classifier_model
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_document_classifier_model
raisingzcx_ibmc_service_exception

Update a document classifier model

Update the document classifier model name or description.
Parameters
i_project_id The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
i_classifier_id The ID of the classifier.
i_model_id The ID of the classifier model.
i_updtdcmntclssfrmdl An object that lists a new name or description for a document classifier model.
e_response Service return value of type T_DOCUMENT_CLASSIFIER_MODEL
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error.