Skip to content

Latest commit

 

History

History
34 lines (27 loc) · 1012 Bytes

README.md

File metadata and controls

34 lines (27 loc) · 1012 Bytes

Discovery

Installation

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

Usage

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

Discovery discovery = new Discovery("2017-11-07");
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>";
QueryOptions queryOptions = new QueryOptions.Builder(environmentId, collectionId).build();
QueryResponse queryResponse = discovery.query(queryOptions).execute();