public class Discovery
extends com.ibm.cloud.sdk.core.service.BaseService
Constructor and Description |
---|
Discovery(java.lang.String versionDate)
Constructs a new `Discovery` client using the DEFAULT_SERVICE_NAME.
|
Discovery(java.lang.String versionDate,
com.ibm.cloud.sdk.core.security.Authenticator authenticator)
Constructs a new `Discovery` client with the DEFAULT_SERVICE_NAME and the specified
Authenticator.
|
Discovery(java.lang.String versionDate,
java.lang.String serviceName)
Constructs a new `Discovery` client with the specified serviceName.
|
Discovery(java.lang.String versionDate,
java.lang.String serviceName,
com.ibm.cloud.sdk.core.security.Authenticator authenticator)
Constructs a new `Discovery` client with the specified Authenticator and serviceName.
|
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<TrainingQuery> |
createTrainingQuery(CreateTrainingQueryOptions createTrainingQueryOptions)
Create training query.
|
com.ibm.cloud.sdk.core.http.ServiceCall<DeleteDocumentResponse> |
deleteDocument(DeleteDocumentOptions deleteDocumentOptions)
Delete a document.
|
com.ibm.cloud.sdk.core.http.ServiceCall<java.lang.Void> |
deleteTrainingQueries(DeleteTrainingQueriesOptions deleteTrainingQueriesOptions)
Delete training queries.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Completions> |
getAutocompletion(GetAutocompletionOptions getAutocompletionOptions)
Get Autocomplete Suggestions.
|
com.ibm.cloud.sdk.core.http.ServiceCall<ComponentSettingsResponse> |
getComponentSettings(GetComponentSettingsOptions getComponentSettingsOptions)
Configuration settings for components.
|
com.ibm.cloud.sdk.core.http.ServiceCall<TrainingQuery> |
getTrainingQuery(GetTrainingQueryOptions getTrainingQueryOptions)
Get a training data query.
|
com.ibm.cloud.sdk.core.http.ServiceCall<ListCollectionsResponse> |
listCollections(ListCollectionsOptions listCollectionsOptions)
List collections.
|
com.ibm.cloud.sdk.core.http.ServiceCall<ListFieldsResponse> |
listFields(ListFieldsOptions listFieldsOptions)
List fields.
|
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> |
queryNotices(QueryNoticesOptions queryNoticesOptions)
Query system notices.
|
com.ibm.cloud.sdk.core.http.ServiceCall<DocumentAccepted> |
updateDocument(UpdateDocumentOptions updateDocumentOptions)
Update a document.
|
com.ibm.cloud.sdk.core.http.ServiceCall<TrainingQuery> |
updateTrainingQuery(UpdateTrainingQueryOptions updateTrainingQueryOptions)
Update a training query.
|
configureClient, configureHttpClient, configureService, createServiceCall, getAuthenticator, getClient, getEndPoint, getName, getServiceUrl, isJsonMimeType, isJsonPatchMimeType, processServiceCall, setAuthentication, setClient, setDefaultHeaders, setDefaultHeaders, setEndPoint, setServiceUrl, toString
public Discovery(java.lang.String versionDate)
versionDate
- The version date (yyyy-MM-dd) of the REST API to use. Specifying this value
will keep your API calls from failing when the service introduces breaking changes.public Discovery(java.lang.String versionDate, com.ibm.cloud.sdk.core.security.Authenticator authenticator)
versionDate
- The version date (yyyy-MM-dd) of the REST API to use. Specifying this value
will keep your API calls from failing when the service introduces breaking changes.authenticator
- the Authenticator instance to be configured for this servicepublic Discovery(java.lang.String versionDate, java.lang.String serviceName)
versionDate
- The version date (yyyy-MM-dd) of the REST API to use. Specifying this value
will keep your API calls from failing when the service introduces breaking changes.serviceName
- The name of the service to configure.public Discovery(java.lang.String versionDate, java.lang.String serviceName, com.ibm.cloud.sdk.core.security.Authenticator authenticator)
versionDate
- The version date (yyyy-MM-dd) of the REST API to use. Specifying this value
will keep your API calls from failing when the service introduces breaking changes.serviceName
- The name of the service to configure.authenticator
- the Authenticator instance to be configured for this servicepublic 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 response type of ListCollectionsResponse
public 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).
queryOptions
- the QueryOptions
containing the options for the callServiceCall
with a response type of 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 response type of Completions
public com.ibm.cloud.sdk.core.http.ServiceCall<QueryNoticesResponse> queryNotices(QueryNoticesOptions queryNoticesOptions)
Queries for notices (errors or warnings) that might have been generated by the system. Notices are generated when ingesting documents and performing relevance training.
queryNoticesOptions
- the QueryNoticesOptions
containing the options for the callServiceCall
with a response type of 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 response type of 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 response type of 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 response type of 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 response type of 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 response type of 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 response type of TrainingQuerySet
public com.ibm.cloud.sdk.core.http.ServiceCall<java.lang.Void> deleteTrainingQueries(DeleteTrainingQueriesOptions deleteTrainingQueriesOptions)
Removes all training queries for the specified project.
deleteTrainingQueriesOptions
- the DeleteTrainingQueriesOptions
containing the
options for the callServiceCall
with a response type of Voidpublic 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 response type of 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 response type of 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 response type of TrainingQuery