Skip to content

Latest commit

 

History

History
 
 

discovery

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Discovery

Installation

Maven
<dependency>
  <groupId>com.ibm.watson.developer_cloud</groupId>
  <artifactId>discovery</artifactId>
  <version>3.5.3</version>
</dependency>
Gradle
'com.ibm.watson.developer_cloud:discovery:3.5.3'

Usage

The Discovery wraps the environment, collection, configuration, document, and query operations of the Discovery service.

Discovery discovery = new Discovery("2016-12-15");
discovery.setEndPoint("https://gateway.watsonplatform.net/discovery/api/");
discovery.setUsernameAndPassword("<username>", "<password>");

//Build an empty query on an existing environment/collection
String environmentId = "<environmentId>";
String collectionId = "<collectionId";
QueryRequest queryRequest = new QueryRequest.Builder(environmentId, collectionId).build();

QueryResponse queryResponse = discovery.query(queryRequest).execute();