Skip to content

Latest commit

 

History

History
33 lines (26 loc) · 934 Bytes

README.md

File metadata and controls

33 lines (26 loc) · 934 Bytes

Discovery

Installation

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

Usage

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

Authenticator authenticator = new IamAuthenticator("<iam_api_key>");
Discovery discovery = new Discovery("2019-04-30", authenticator);

//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().getResult();