We are migrating from Watson Java SDK 3.8.0 to the latest one (4.2.1). While doing the migration, I took the Watson Discovery code snippet given in this section https://www.ibm.com/watson/developercloud/discovery/api/v1/?java#query-collection
Discovery discovery = new Discovery("2017-11-07");
discovery.setEndPoint("https://gateway.watsonplatform.net/discovery/api/");
discovery.setUsernameAndPassword("{username}", "{password}");
String environmentId = "{environment_id}";
String collectionId = "{collection_id}";
QueryRequest.Builder queryBuilder = new QueryRequest.Builder(environmentId, collectionId);
queryBuilder.query("{field}:{value}");
QueryResponse queryResponse = discovery.query(queryBuilder.build()).execute();
But looks like the 4.2.1 jar does not contain QueryRequest class, I am not able to find it. Is the code snippet given on the api reference page old?
Instead of query request use QueryOptions as new sdk doesnt contains query request.