public class Discovery
extends com.ibm.cloud.sdk.core.service.BaseService
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_SERVICE_NAME |
static String |
DEFAULT_SERVICE_URL |
Constructor and Description |
---|
Discovery(String version)
Constructs an instance of the `Discovery` client.
|
Discovery(String version,
com.ibm.cloud.sdk.core.security.Authenticator authenticator)
Constructs an instance of the `Discovery` client.
|
Discovery(String version,
String serviceName)
Constructs an instance of the `Discovery` client.
|
Discovery(String version,
String serviceName,
com.ibm.cloud.sdk.core.security.Authenticator authenticator)
Constructs an instance of the `Discovery` client.
|
Modifier and Type | Method and Description |
---|---|
com.ibm.cloud.sdk.core.http.ServiceCall<DocumentAccepted> |
addDocument(AddDocumentOptions addDocumentOptions)
Add a document.
|
com.ibm.cloud.sdk.core.http.ServiceCall<AnalyzedDocument> |
analyzeDocument(AnalyzeDocumentOptions analyzeDocumentOptions)
Analyze a Document.
|
com.ibm.cloud.sdk.core.http.ServiceCall<CollectionDetails> |
createCollection(CreateCollectionOptions createCollectionOptions)
Create a collection.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Enrichment> |
createEnrichment(CreateEnrichmentOptions createEnrichmentOptions)
Create an enrichment.
|
com.ibm.cloud.sdk.core.http.ServiceCall<ProjectDetails> |
createProject(CreateProjectOptions createProjectOptions)
Create a Project.
|
com.ibm.cloud.sdk.core.http.ServiceCall<TrainingQuery> |
createTrainingQuery(CreateTrainingQueryOptions createTrainingQueryOptions)
Create training query.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Void> |
deleteCollection(DeleteCollectionOptions deleteCollectionOptions)
Delete a collection.
|
com.ibm.cloud.sdk.core.http.ServiceCall<DeleteDocumentResponse> |
deleteDocument(DeleteDocumentOptions deleteDocumentOptions)
Delete a document.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Void> |
deleteEnrichment(DeleteEnrichmentOptions deleteEnrichmentOptions)
Delete an enrichment.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Void> |
deleteProject(DeleteProjectOptions deleteProjectOptions)
Delete a project.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Void> |
deleteTrainingQueries(DeleteTrainingQueriesOptions deleteTrainingQueriesOptions)
Delete training queries.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Void> |
deleteTrainingQuery(DeleteTrainingQueryOptions deleteTrainingQueryOptions)
Delete a training data query.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Void> |
deleteUserData(DeleteUserDataOptions deleteUserDataOptions)
Delete labeled data.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Completions> |
getAutocompletion(GetAutocompletionOptions getAutocompletionOptions)
Get Autocomplete Suggestions.
|
com.ibm.cloud.sdk.core.http.ServiceCall<CollectionDetails> |
getCollection(GetCollectionOptions getCollectionOptions)
Get collection.
|
com.ibm.cloud.sdk.core.http.ServiceCall<ComponentSettingsResponse> |
getComponentSettings(GetComponentSettingsOptions getComponentSettingsOptions)
List component settings.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Enrichment> |
getEnrichment(GetEnrichmentOptions getEnrichmentOptions)
Get enrichment.
|
com.ibm.cloud.sdk.core.http.ServiceCall<ProjectDetails> |
getProject(GetProjectOptions getProjectOptions)
Get project.
|
com.ibm.cloud.sdk.core.http.ServiceCall<TrainingQuery> |
getTrainingQuery(GetTrainingQueryOptions getTrainingQueryOptions)
Get a training data query.
|
String |
getVersion()
Gets the version.
|
com.ibm.cloud.sdk.core.http.ServiceCall<ListCollectionsResponse> |
listCollections(ListCollectionsOptions listCollectionsOptions)
List collections.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Enrichments> |
listEnrichments(ListEnrichmentsOptions listEnrichmentsOptions)
List Enrichments.
|
com.ibm.cloud.sdk.core.http.ServiceCall<ListFieldsResponse> |
listFields(ListFieldsOptions listFieldsOptions)
List fields.
|
com.ibm.cloud.sdk.core.http.ServiceCall<ListProjectsResponse> |
listProjects()
List projects.
|
com.ibm.cloud.sdk.core.http.ServiceCall<ListProjectsResponse> |
listProjects(ListProjectsOptions listProjectsOptions)
List projects.
|
com.ibm.cloud.sdk.core.http.ServiceCall<TrainingQuerySet> |
listTrainingQueries(ListTrainingQueriesOptions listTrainingQueriesOptions)
List training queries.
|
com.ibm.cloud.sdk.core.http.ServiceCall<QueryResponse> |
query(QueryOptions queryOptions)
Query a project.
|
com.ibm.cloud.sdk.core.http.ServiceCall<QueryNoticesResponse> |
queryCollectionNotices(QueryCollectionNoticesOptions queryCollectionNoticesOptions)
Query collection notices.
|
com.ibm.cloud.sdk.core.http.ServiceCall<QueryNoticesResponse> |
queryNotices(QueryNoticesOptions queryNoticesOptions)
Query project notices.
|
void |
setVersion(String version)
Sets the version.
|
com.ibm.cloud.sdk.core.http.ServiceCall<CollectionDetails> |
updateCollection(UpdateCollectionOptions updateCollectionOptions)
Update a collection.
|
com.ibm.cloud.sdk.core.http.ServiceCall<DocumentAccepted> |
updateDocument(UpdateDocumentOptions updateDocumentOptions)
Update a document.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Enrichment> |
updateEnrichment(UpdateEnrichmentOptions updateEnrichmentOptions)
Update an enrichment.
|
com.ibm.cloud.sdk.core.http.ServiceCall<ProjectDetails> |
updateProject(UpdateProjectOptions updateProjectOptions)
Update a project.
|
com.ibm.cloud.sdk.core.http.ServiceCall<TrainingQuery> |
updateTrainingQuery(UpdateTrainingQueryOptions updateTrainingQueryOptions)
Update a training query.
|
public static final String DEFAULT_SERVICE_NAME
public static final String DEFAULT_SERVICE_URL
public Discovery(String version)
version
- Release date of the version of the API you want to use. Specify dates in
YYYY-MM-DD format. The current version is `2019-11-22`.public Discovery(String version, com.ibm.cloud.sdk.core.security.Authenticator authenticator)
version
- Release date of the version of the API you want to use. Specify dates in
YYYY-MM-DD format. The current version is `2019-11-22`.authenticator
- the Authenticator
instance to be configured for this clientpublic Discovery(String version, String serviceName)
version
- Release date of the version of the API you want to use. Specify dates in
YYYY-MM-DD format. The current version is `2019-11-22`.serviceName
- the service name to be used when configuring the client instancepublic Discovery(String version, String serviceName, com.ibm.cloud.sdk.core.security.Authenticator authenticator)
version
- Release date of the version of the API you want to use. Specify dates in
YYYY-MM-DD format. The current version is `2019-11-22`.serviceName
- the service name to be used when configuring the client instanceauthenticator
- the Authenticator
instance to be configured for this clientpublic String getVersion()
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is `2019-11-22`.
public void setVersion(String version)
version
- the new versionpublic com.ibm.cloud.sdk.core.http.ServiceCall<ListCollectionsResponse> listCollections(ListCollectionsOptions listCollectionsOptions)
Lists existing collections for the specified project.
listCollectionsOptions
- the ListCollectionsOptions
containing the options for the
callServiceCall
with a result of type ListCollectionsResponse
public com.ibm.cloud.sdk.core.http.ServiceCall<CollectionDetails> createCollection(CreateCollectionOptions createCollectionOptions)
Create a new collection in the specified project.
createCollectionOptions
- the CreateCollectionOptions
containing the options for
the callServiceCall
with a result of type CollectionDetails
public com.ibm.cloud.sdk.core.http.ServiceCall<CollectionDetails> getCollection(GetCollectionOptions getCollectionOptions)
Get details about the specified collection.
getCollectionOptions
- the GetCollectionOptions
containing the options for the
callServiceCall
with a result of type CollectionDetails
public com.ibm.cloud.sdk.core.http.ServiceCall<CollectionDetails> updateCollection(UpdateCollectionOptions updateCollectionOptions)
Updates the specified collection's name, description, and enrichments.
updateCollectionOptions
- the UpdateCollectionOptions
containing the options for
the callServiceCall
with a result of type CollectionDetails
public com.ibm.cloud.sdk.core.http.ServiceCall<Void> deleteCollection(DeleteCollectionOptions deleteCollectionOptions)
Deletes the specified collection from the project. All documents stored in the specified collection and not shared is also deleted.
deleteCollectionOptions
- the DeleteCollectionOptions
containing the options for
the callServiceCall
with a void resultpublic com.ibm.cloud.sdk.core.http.ServiceCall<QueryResponse> query(QueryOptions queryOptions)
By using this method, you can construct queries. For details, see the [Discovery documentation](https://cloud.ibm.com/docs/discovery-data?topic=discovery-data-query-concepts). The default query parameters are defined by the settings for this project, see the [Discovery documentation](https://cloud.ibm.com/docs/discovery-data?topic=discovery-data-project-defaults) for an overview of the standard default settings, and see [the Projects API documentation](#create-project) for details about how to set custom default query settings.
queryOptions
- the QueryOptions
containing the options for the callServiceCall
with a result of type QueryResponse
public com.ibm.cloud.sdk.core.http.ServiceCall<Completions> getAutocompletion(GetAutocompletionOptions getAutocompletionOptions)
Returns completion query suggestions for the specified prefix.
getAutocompletionOptions
- the GetAutocompletionOptions
containing the options for
the callServiceCall
with a result of type Completions
public com.ibm.cloud.sdk.core.http.ServiceCall<QueryNoticesResponse> queryCollectionNotices(QueryCollectionNoticesOptions queryCollectionNoticesOptions)
Finds collection-level notices (errors and warnings) that are generated when documents are ingested.
queryCollectionNoticesOptions
- the QueryCollectionNoticesOptions
containing the
options for the callServiceCall
with a result of type QueryNoticesResponse
public com.ibm.cloud.sdk.core.http.ServiceCall<QueryNoticesResponse> queryNotices(QueryNoticesOptions queryNoticesOptions)
Finds project-level notices (errors and warnings). Currently, project-level notices are generated by relevancy training.
queryNoticesOptions
- the QueryNoticesOptions
containing the options for the callServiceCall
with a result of type QueryNoticesResponse
public com.ibm.cloud.sdk.core.http.ServiceCall<ListFieldsResponse> listFields(ListFieldsOptions listFieldsOptions)
Gets a list of the unique fields (and their types) stored in the the specified collections.
listFieldsOptions
- the ListFieldsOptions
containing the options for the callServiceCall
with a result of type ListFieldsResponse
public com.ibm.cloud.sdk.core.http.ServiceCall<ComponentSettingsResponse> getComponentSettings(GetComponentSettingsOptions getComponentSettingsOptions)
Returns default configuration settings for components.
getComponentSettingsOptions
- the GetComponentSettingsOptions
containing the
options for the callServiceCall
with a result of type ComponentSettingsResponse
public com.ibm.cloud.sdk.core.http.ServiceCall<DocumentAccepted> addDocument(AddDocumentOptions addDocumentOptions)
Add a document to a collection with optional metadata.
Returns immediately after the system has accepted the document for processing.
* The user must provide document content, metadata, or both. If the request is missing both document content and metadata, it is rejected.
* The user 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.
* The following field names are reserved and will be filtered out if present after normalization: `id`, `score`, `highlight`, and any field with the prefix of: `_`, `+`, or `-`
* Fields with empty name values after normalization are filtered out before indexing.
* Fields containing the following characters after normalization are filtered out before indexing: `#` and `,`
If the document is uploaded to a collection that has it's data shared with another collection, the **X-Watson-Discovery-Force** header must be set to `true`.
**Note:** Documents can be added with a specific **document_id** by using the **_/v2/projects/{project_id}/collections/{collection_id}/documents** method.
**Note:** This operation only works on collections created to accept direct file uploads. It cannot be used to modify a collection that connects to an external source such as Microsoft SharePoint.
addDocumentOptions
- the AddDocumentOptions
containing the options for the callServiceCall
with a result of type DocumentAccepted
public com.ibm.cloud.sdk.core.http.ServiceCall<DocumentAccepted> updateDocument(UpdateDocumentOptions updateDocumentOptions)
Replace an existing document or add a document with a specified **document_id**. Starts ingesting a document with optional metadata.
If the document is uploaded to a collection that has it's data shared with another collection, the **X-Watson-Discovery-Force** header must be set to `true`.
**Note:** When uploading a new document with this method it automatically replaces any document stored with the same **document_id** if it exists.
**Note:** This operation only works on collections created to accept direct file uploads. It cannot be used to modify a collection that connects to an external source such as Microsoft SharePoint.
**Note:** If an uploaded document is segmented, all segments will be overwritten, even if the updated version of the document has fewer segments.
updateDocumentOptions
- the UpdateDocumentOptions
containing the options for the
callServiceCall
with a result of type DocumentAccepted
public com.ibm.cloud.sdk.core.http.ServiceCall<DeleteDocumentResponse> deleteDocument(DeleteDocumentOptions deleteDocumentOptions)
If the given document ID is invalid, or if the document is not found, then the a success response is returned (HTTP status code `200`) with the status set to 'deleted'.
**Note:** This operation only works on collections created to accept direct file uploads. It cannot be used to modify a collection that connects to an external source such as Microsoft SharePoint.
**Note:** Segments of an uploaded document cannot be deleted individually. Delete all segments by deleting using the `parent_document_id` of a segment result.
deleteDocumentOptions
- the DeleteDocumentOptions
containing the options for the
callServiceCall
with a result of type DeleteDocumentResponse
public com.ibm.cloud.sdk.core.http.ServiceCall<TrainingQuerySet> listTrainingQueries(ListTrainingQueriesOptions listTrainingQueriesOptions)
List the training queries for the specified project.
listTrainingQueriesOptions
- the ListTrainingQueriesOptions
containing the options
for the callServiceCall
with a result of type TrainingQuerySet
public com.ibm.cloud.sdk.core.http.ServiceCall<Void> deleteTrainingQueries(DeleteTrainingQueriesOptions deleteTrainingQueriesOptions)
Removes all training queries for the specified project.
deleteTrainingQueriesOptions
- the DeleteTrainingQueriesOptions
containing the
options for the callServiceCall
with a void resultpublic com.ibm.cloud.sdk.core.http.ServiceCall<TrainingQuery> createTrainingQuery(CreateTrainingQueryOptions createTrainingQueryOptions)
Add a query to the training data for this project. The query can contain a filter and natural language query.
createTrainingQueryOptions
- the CreateTrainingQueryOptions
containing the options
for the callServiceCall
with a result of type TrainingQuery
public com.ibm.cloud.sdk.core.http.ServiceCall<TrainingQuery> getTrainingQuery(GetTrainingQueryOptions getTrainingQueryOptions)
Get details for a specific training data query, including the query string and all examples.
getTrainingQueryOptions
- the GetTrainingQueryOptions
containing the options for
the callServiceCall
with a result of type TrainingQuery
public com.ibm.cloud.sdk.core.http.ServiceCall<TrainingQuery> updateTrainingQuery(UpdateTrainingQueryOptions updateTrainingQueryOptions)
Updates an existing training query and it's examples.
updateTrainingQueryOptions
- the UpdateTrainingQueryOptions
containing the options
for the callServiceCall
with a result of type TrainingQuery
public com.ibm.cloud.sdk.core.http.ServiceCall<Void> deleteTrainingQuery(DeleteTrainingQueryOptions deleteTrainingQueryOptions)
Removes details from a training data query, including the query string and all examples.
deleteTrainingQueryOptions
- the DeleteTrainingQueryOptions
containing the options
for the callServiceCall
with a void resultpublic com.ibm.cloud.sdk.core.http.ServiceCall<AnalyzedDocument> analyzeDocument(AnalyzeDocumentOptions analyzeDocumentOptions)
Process a document using the specified collection's settings and return it for realtime use.
**Note:** Documents processed using this method are not added to the specified collection.
**Note:** This method is only supported on IBM Cloud Pak for Data instances of Discovery.
analyzeDocumentOptions
- the AnalyzeDocumentOptions
containing the options for the
callServiceCall
with a result of type AnalyzedDocument
public com.ibm.cloud.sdk.core.http.ServiceCall<Enrichments> listEnrichments(ListEnrichmentsOptions listEnrichmentsOptions)
List the enrichments available to this project.
listEnrichmentsOptions
- the ListEnrichmentsOptions
containing the options for the
callServiceCall
with a result of type Enrichments
public com.ibm.cloud.sdk.core.http.ServiceCall<Enrichment> createEnrichment(CreateEnrichmentOptions createEnrichmentOptions)
Create an enrichment for use with the specified project/.
createEnrichmentOptions
- the CreateEnrichmentOptions
containing the options for
the callServiceCall
with a result of type Enrichment
public com.ibm.cloud.sdk.core.http.ServiceCall<Enrichment> getEnrichment(GetEnrichmentOptions getEnrichmentOptions)
Get details about a specific enrichment.
getEnrichmentOptions
- the GetEnrichmentOptions
containing the options for the
callServiceCall
with a result of type Enrichment
public com.ibm.cloud.sdk.core.http.ServiceCall<Enrichment> updateEnrichment(UpdateEnrichmentOptions updateEnrichmentOptions)
Updates an existing enrichment's name and description.
updateEnrichmentOptions
- the UpdateEnrichmentOptions
containing the options for
the callServiceCall
with a result of type Enrichment
public com.ibm.cloud.sdk.core.http.ServiceCall<Void> deleteEnrichment(DeleteEnrichmentOptions deleteEnrichmentOptions)
Deletes an existing enrichment from the specified project.
**Note:** Only enrichments that have been manually created can be deleted.
deleteEnrichmentOptions
- the DeleteEnrichmentOptions
containing the options for
the callServiceCall
with a void resultpublic com.ibm.cloud.sdk.core.http.ServiceCall<ListProjectsResponse> listProjects(ListProjectsOptions listProjectsOptions)
Lists existing projects for this instance.
listProjectsOptions
- the ListProjectsOptions
containing the options for the callServiceCall
with a result of type ListProjectsResponse
public com.ibm.cloud.sdk.core.http.ServiceCall<ListProjectsResponse> listProjects()
Lists existing projects for this instance.
ServiceCall
with a result of type ListProjectsResponse
public com.ibm.cloud.sdk.core.http.ServiceCall<ProjectDetails> createProject(CreateProjectOptions createProjectOptions)
Create a new project for this instance.
createProjectOptions
- the CreateProjectOptions
containing the options for the
callServiceCall
with a result of type ProjectDetails
public com.ibm.cloud.sdk.core.http.ServiceCall<ProjectDetails> getProject(GetProjectOptions getProjectOptions)
Get details on the specified project.
getProjectOptions
- the GetProjectOptions
containing the options for the callServiceCall
with a result of type ProjectDetails
public com.ibm.cloud.sdk.core.http.ServiceCall<ProjectDetails> updateProject(UpdateProjectOptions updateProjectOptions)
Update the specified project's name.
updateProjectOptions
- the UpdateProjectOptions
containing the options for the
callServiceCall
with a result of type ProjectDetails
public com.ibm.cloud.sdk.core.http.ServiceCall<Void> deleteProject(DeleteProjectOptions deleteProjectOptions)
Deletes the specified project.
**Important:** Deleting a project deletes everything that is part of the specified project, including all collections.
deleteProjectOptions
- the DeleteProjectOptions
containing the options for the
callServiceCall
with a void resultpublic com.ibm.cloud.sdk.core.http.ServiceCall<Void> deleteUserData(DeleteUserDataOptions deleteUserDataOptions)
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](https://cloud.ibm.com/docs/discovery-data?topic=discovery-data-information-security#information-security).
**Note:** This method is only supported on IBM Cloud instances of Discovery.
deleteUserDataOptions
- the DeleteUserDataOptions
containing the options for the
callServiceCall
with a void resultCopyright © 2021 IBM Cloud. All rights reserved.