GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — java-sdk/discovery at master · jaymicrocode/java-sdk

Expand file tree

/

discovery

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

discovery

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
src
src
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
ibm-credentials.env
ibm-credentials.env
 
 

README.md

Outline

Discovery

Installation

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

Usage

This SDK supports both the Discovery v1 and v2 APIs. Please note that the Discovery v2 API is accessible only on Cloud Pak for Data.

Otherwise, the APIs are fairly similar, offering the ability to manage collections of documents and query them for insights. You can learn more about the Discovery service here.

Using Discovery v1

// Make sure to use the Discovery v1 import!
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 = "<environment_id>";
String collectionId = "<collection_id>";
QueryOptions queryOptions = new QueryOptions.Builder(environmentId, collectionId).build();
QueryResponse queryResponse = discovery.query(queryOptions).execute().getResult();

Using Discovery v2

// Make sure to use the Discovery v2 import!
Authenticator authenticator = new BearerTokenAuthenticator("<bearer_token>");
Discovery discovery = new Discovery("2019-11-22", authenticator);

// Build an empty query on an existing project.
String projectId = "<project_id>";
QueryOptions queryOptions = new QueryOptions.Builder()
  .projectId(projectId)
  .build();
QueryResponse queryResponse = discovery.query(queryOptions).execute().getResult();
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.