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 — Add newest generated Discovery code · windofthesky/java-sdk@8fdf2a7

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • discovery/src/main/java/com/ibm/watson/developer_cloud/discovery/v1
    • Discovery.java
    • model
      • AddDocumentOptions.java
      • AddTrainingDataOptions.java
      • AggregationResult.java
      • Calculation.java
      • Collection.java
      • CollectionDiskUsage.java
      • CollectionUsage.java
      • Configuration.java
      • Conversions.java
      • CreateCollectionOptions.java
      • CreateConfigurationOptions.java
      • CreateEnvironmentOptions.java
      • CreateExpansionsOptions.java
      • CreateTrainingExampleOptions.java
      • DeleteAllTrainingDataOptions.java
      • DeleteCollectionOptions.java
      • DeleteConfigurationOptions.java
      • DeleteDocumentOptions.java
      • DeleteEnvironmentOptions.java
      • DeleteExpansionsOptions.java
      • DeleteTrainingDataOptions.java
      • DeleteTrainingExampleOptions.java
      • DiskUsage.java
      • DocumentAccepted.java
      • DocumentCounts.java
      • DocumentSnapshot.java
      • DocumentStatus.java
      • Enrichment.java
      • EnrichmentOptions.java
      • Environment.java
      • EnvironmentDocuments.java
      • Expansion.java
      • Expansions.java
      • FederatedQueryNoticesOptions.java
      • FederatedQueryOptions.java
      • Field.java
      • FontSetting.java
      • GetCollectionOptions.java
      • GetConfigurationOptions.java
      • GetDocumentStatusOptions.java
      • GetEnvironmentOptions.java
      • GetTrainingDataOptions.java
      • GetTrainingExampleOptions.java
      • Histogram.java
      • HtmlSettings.java
      • IndexCapacity.java
      • ListCollectionFieldsOptions.java
      • ListCollectionFieldsResponse.java
      • ListCollectionsOptions.java
      • ListCollectionsResponse.java
      • ListConfigurationsOptions.java
      • ListConfigurationsResponse.java
      • ListEnvironmentsOptions.java
      • ListEnvironmentsResponse.java
      • ListExpansionsOptions.java
      • ListFieldsOptions.java
      • ListTrainingDataOptions.java
      • ListTrainingExamplesOptions.java
      • MemoryUsage.java
      • NluEnrichmentCategories.java
      • NluEnrichmentEmotion.java
      • NluEnrichmentEntities.java
      • NluEnrichmentFeatures.java
      • NluEnrichmentKeywords.java
      • NluEnrichmentRelations.java
      • NluEnrichmentSemanticRoles.java
      • NluEnrichmentSentiment.java
      • NormalizationOperation.java
      • Notice.java
      • PdfHeadingDetection.java
      • PdfSettings.java
      • QueryAggregation.java
      • QueryEntitiesContext.java
      • QueryEntitiesEntity.java
      • QueryEntitiesOptions.java
      • QueryEntitiesResponse.java
      • QueryFilterType.java
      • QueryNoticesOptions.java
      • QueryNoticesResponse.java
      • QueryNoticesResult.java
      • QueryOptions.java
      • QueryPassages.java
      • QueryRelationsArgument.java
      • QueryRelationsEntity.java
      • QueryRelationsFilter.java
      • QueryRelationsOptions.java
      • QueryRelationsRelationship.java
      • QueryRelationsResponse.java
      • QueryResponse.java
      • QueryResult.java
      • QueryResultResultMetadata.java
      • Term.java
      • TestConfigurationInEnvironmentOptions.java
      • TestDocument.java
      • TrainingDataSet.java
      • TrainingExample.java
      • TrainingExampleList.java
      • TrainingQuery.java
      • TrainingStatus.java
      • UpdateCollectionOptions.java
      • UpdateConfigurationOptions.java
      • UpdateDocumentOptions.java
      • UpdateEnvironmentOptions.java
      • UpdateTrainingExampleOptions.java
      • WordHeadingDetection.java
      • WordSettings.java
      • WordStyle.java
      • XPathPatterns.java

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎discovery/src/main/java/com/ibm/watson/developer_cloud/discovery/v1/Discovery.java‎

Copy file name to clipboardExpand all lines: discovery/src/main/java/com/ibm/watson/developer_cloud/discovery/v1/Discovery.java
+66-6Lines changed: 66 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 IBM Corp. All Rights Reserved.
2+
* Copyright 2018 IBM Corp. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -12,9 +12,6 @@
1212
*/
1313
package com.ibm.watson.developer_cloud.discovery.v1;
1414

15-
import okhttp3.MultipartBody;
16-
import okhttp3.RequestBody;
17-
import com.ibm.watson.developer_cloud.util.RequestUtils;
1815
import com.google.gson.JsonObject;
1916
import com.ibm.watson.developer_cloud.discovery.v1.model.AddDocumentOptions;
2017
import com.ibm.watson.developer_cloud.discovery.v1.model.AddTrainingDataOptions;
@@ -23,17 +20,20 @@
2320
import com.ibm.watson.developer_cloud.discovery.v1.model.CreateCollectionOptions;
2421
import com.ibm.watson.developer_cloud.discovery.v1.model.CreateConfigurationOptions;
2522
import com.ibm.watson.developer_cloud.discovery.v1.model.CreateEnvironmentOptions;
23+
import com.ibm.watson.developer_cloud.discovery.v1.model.CreateExpansionsOptions;
2624
import com.ibm.watson.developer_cloud.discovery.v1.model.CreateTrainingExampleOptions;
2725
import com.ibm.watson.developer_cloud.discovery.v1.model.DeleteAllTrainingDataOptions;
2826
import com.ibm.watson.developer_cloud.discovery.v1.model.DeleteCollectionOptions;
2927
import com.ibm.watson.developer_cloud.discovery.v1.model.DeleteConfigurationOptions;
3028
import com.ibm.watson.developer_cloud.discovery.v1.model.DeleteDocumentOptions;
3129
import com.ibm.watson.developer_cloud.discovery.v1.model.DeleteEnvironmentOptions;
30+
import com.ibm.watson.developer_cloud.discovery.v1.model.DeleteExpansionsOptions;
3231
import com.ibm.watson.developer_cloud.discovery.v1.model.DeleteTrainingDataOptions;
3332
import com.ibm.watson.developer_cloud.discovery.v1.model.DeleteTrainingExampleOptions;
3433
import com.ibm.watson.developer_cloud.discovery.v1.model.DocumentAccepted;
3534
import com.ibm.watson.developer_cloud.discovery.v1.model.DocumentStatus;
3635
import com.ibm.watson.developer_cloud.discovery.v1.model.Environment;
36+
import com.ibm.watson.developer_cloud.discovery.v1.model.Expansions;
3737
import com.ibm.watson.developer_cloud.discovery.v1.model.FederatedQueryNoticesOptions;
3838
import com.ibm.watson.developer_cloud.discovery.v1.model.FederatedQueryOptions;
3939
import com.ibm.watson.developer_cloud.discovery.v1.model.GetCollectionOptions;
@@ -50,6 +50,7 @@
5050
import com.ibm.watson.developer_cloud.discovery.v1.model.ListConfigurationsResponse;
5151
import com.ibm.watson.developer_cloud.discovery.v1.model.ListEnvironmentsOptions;
5252
import com.ibm.watson.developer_cloud.discovery.v1.model.ListEnvironmentsResponse;
53+
import com.ibm.watson.developer_cloud.discovery.v1.model.ListExpansionsOptions;
5354
import com.ibm.watson.developer_cloud.discovery.v1.model.ListFieldsOptions;
5455
import com.ibm.watson.developer_cloud.discovery.v1.model.ListTrainingDataOptions;
5556
import com.ibm.watson.developer_cloud.discovery.v1.model.ListTrainingExamplesOptions;
@@ -76,8 +77,11 @@
7677
import com.ibm.watson.developer_cloud.http.ServiceCall;
7778
import com.ibm.watson.developer_cloud.service.WatsonService;
7879
import com.ibm.watson.developer_cloud.util.GsonSingleton;
80+
import com.ibm.watson.developer_cloud.util.RequestUtils;
7981
import com.ibm.watson.developer_cloud.util.ResponseConverterUtils;
8082
import com.ibm.watson.developer_cloud.util.Validator;
83+
import okhttp3.MultipartBody;
84+
import okhttp3.RequestBody;
8185

8286
/**
8387
* The IBM Watson Discovery Service is a cognitive search and content analytics engine that you can add to applications
@@ -212,7 +216,7 @@ public ServiceCall<ListEnvironmentsResponse> listEnvironments(ListEnvironmentsOp
212216
}
213217

214218
/**
215-
* List environments
219+
* List environments.
216220
*
217221
* List existing environments for the service instance.
218222
*
@@ -462,6 +466,28 @@ public ServiceCall<Collection> createCollection(CreateCollectionOptions createCo
462466
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(Collection.class));
463467
}
464468

469+
/**
470+
* Set the expansion list.
471+
*
472+
* Create or replace the Expansion list for this collection. The maximum number of expanded terms per collection is
473+
* `500`. The current expansion list is replaced with the uploaded content.
474+
*
475+
* @param createExpansionsOptions the {@link CreateExpansionsOptions} containing the options for the call
476+
* @return a {@link ServiceCall} with a response type of {@link Expansions}
477+
*/
478+
public ServiceCall<Expansions> createExpansions(CreateExpansionsOptions createExpansionsOptions) {
479+
Validator.notNull(createExpansionsOptions, "createExpansionsOptions cannot be null");
480+
RequestBuilder builder = RequestBuilder.post(String.format("/v1/environments/%s/collections/%s/expansions",
481+
createExpansionsOptions.environmentId(), createExpansionsOptions.collectionId()));
482+
builder.query(VERSION, versionDate);
483+
final JsonObject contentJson = new JsonObject();
484+
if (createExpansionsOptions.expansions() != null) {
485+
contentJson.add("expansions", GsonSingleton.getGson().toJsonTree(createExpansionsOptions.expansions()));
486+
}
487+
builder.bodyJson(contentJson);
488+
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(Expansions.class));
489+
}
490+
465491
/**
466492
* Delete a collection.
467493
*
@@ -476,6 +502,23 @@ public ServiceCall<Void> deleteCollection(DeleteCollectionOptions deleteCollecti
476502
return createServiceCall(builder.build(), ResponseConverterUtils.getVoid());
477503
}
478504

505+
/**
506+
* Delete the expansions list.
507+
*
508+
* Remove the expansion information for this collection. The expansion list must be deleted to disable query expansion
509+
* for a collection.
510+
*
511+
* @param deleteExpansionsOptions the {@link DeleteExpansionsOptions} containing the options for the call
512+
* @return a {@link ServiceCall} with a response type of Void
513+
*/
514+
public ServiceCall<Void> deleteExpansions(DeleteExpansionsOptions deleteExpansionsOptions) {
515+
Validator.notNull(deleteExpansionsOptions, "deleteExpansionsOptions cannot be null");
516+
RequestBuilder builder = RequestBuilder.delete(String.format("/v1/environments/%s/collections/%s/expansions",
517+
deleteExpansionsOptions.environmentId(), deleteExpansionsOptions.collectionId()));
518+
builder.query(VERSION, versionDate);
519+
return createServiceCall(builder.build(), ResponseConverterUtils.getVoid());
520+
}
521+
479522
/**
480523
* Get collection details.
481524
*
@@ -526,6 +569,23 @@ public ServiceCall<ListCollectionsResponse> listCollections(ListCollectionsOptio
526569
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(ListCollectionsResponse.class));
527570
}
528571

572+
/**
573+
* List current expansions.
574+
*
575+
* Returns the current expansion list for the specified collection. If an expansion list is not specified, an object
576+
* with empty expansion arrays is returned.
577+
*
578+
* @param listExpansionsOptions the {@link ListExpansionsOptions} containing the options for the call
579+
* @return a {@link ServiceCall} with a response type of {@link Expansions}
580+
*/
581+
public ServiceCall<Expansions> listExpansions(ListExpansionsOptions listExpansionsOptions) {
582+
Validator.notNull(listExpansionsOptions, "listExpansionsOptions cannot be null");
583+
RequestBuilder builder = RequestBuilder.get(String.format("/v1/environments/%s/collections/%s/expansions",
584+
listExpansionsOptions.environmentId(), listExpansionsOptions.collectionId()));
585+
builder.query(VERSION, versionDate);
586+
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(Expansions.class));
587+
}
588+
529589
/**
530590
* Update a collection.
531591
*
@@ -562,7 +622,7 @@ public ServiceCall<Collection> updateCollection(UpdateCollectionOptions updateCo
562622
* service attempts to automatically detect the document's media type. * The following field names are reserved and
563623
* will be filtered out if present after normalization: `id`, `score`, `highlight`, and any field with the prefix of:
564624
* `_`, `+`, or `-` * Fields with empty name values after normalization are filtered out before indexing. * Fields
565-
* containing the following characters after normalization are filtered out before indexing: `#` and `,`
625+
* containing the following characters after normalization are filtered out before indexing: `#` and `,`.
566626
*
567627
* @param addDocumentOptions the {@link AddDocumentOptions} containing the options for the call
568628
* @return a {@link ServiceCall} with a response type of {@link DocumentAccepted}
Collapse file

‎discovery/src/main/java/com/ibm/watson/developer_cloud/discovery/v1/model/AddDocumentOptions.java‎

Copy file name to clipboardExpand all lines: discovery/src/main/java/com/ibm/watson/developer_cloud/discovery/v1/model/AddDocumentOptions.java
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 IBM Corp. All Rights Reserved.
2+
* Copyright 2018 IBM Corp. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -231,7 +231,7 @@ public String filename() {
231231
*
232232
* If you're using the Data Crawler to upload your documents, you can test a document against the type of metadata
233233
* that the Data Crawler might send. The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 MB
234-
* are rejected. Example: ``` { "Creator": "Johnny Appleseed", "Subject": "Apples" } ```
234+
* are rejected. Example: ``` { "Creator": "Johnny Appleseed", "Subject": "Apples" } ```.
235235
*
236236
* @return the metadata
237237
*/
Collapse file

‎discovery/src/main/java/com/ibm/watson/developer_cloud/discovery/v1/model/AddTrainingDataOptions.java‎

Copy file name to clipboardExpand all lines: discovery/src/main/java/com/ibm/watson/developer_cloud/discovery/v1/model/AddTrainingDataOptions.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 IBM Corp. All Rights Reserved.
2+
* Copyright 2018 IBM Corp. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
Collapse file

‎discovery/src/main/java/com/ibm/watson/developer_cloud/discovery/v1/model/AggregationResult.java‎

Copy file name to clipboardExpand all lines: discovery/src/main/java/com/ibm/watson/developer_cloud/discovery/v1/model/AggregationResult.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 IBM Corp. All Rights Reserved.
2+
* Copyright 2018 IBM Corp. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
Collapse file

‎discovery/src/main/java/com/ibm/watson/developer_cloud/discovery/v1/model/Calculation.java‎

Copy file name to clipboardExpand all lines: discovery/src/main/java/com/ibm/watson/developer_cloud/discovery/v1/model/Calculation.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 IBM Corp. All Rights Reserved.
2+
* Copyright 2018 IBM Corp. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
Collapse file

‎discovery/src/main/java/com/ibm/watson/developer_cloud/discovery/v1/model/Collection.java‎

Copy file name to clipboardExpand all lines: discovery/src/main/java/com/ibm/watson/developer_cloud/discovery/v1/model/Collection.java
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 IBM Corp. All Rights Reserved.
2+
* Copyright 2018 IBM Corp. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -87,7 +87,7 @@ public String getDescription() {
8787
/**
8888
* Gets the created.
8989
*
90-
* The creation date of the collection in the format yyyy-MM-dd'T'HH:mmcon:ss.SSS'Z'
90+
* The creation date of the collection in the format yyyy-MM-dd'T'HH:mmcon:ss.SSS'Z'.
9191
*
9292
* @return the created
9393
*/
@@ -98,7 +98,7 @@ public Date getCreated() {
9898
/**
9999
* Gets the updated.
100100
*
101-
* The timestamp of when the collection was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
101+
* The timestamp of when the collection was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
102102
*
103103
* @return the updated
104104
*/
@@ -131,8 +131,8 @@ public String getConfigurationId() {
131131
/**
132132
* Gets the language.
133133
*
134-
* The language of the documents stored in the collection. Permitted values include `en_us` (U.S. English), `de`
135-
* (German), and `es` (Spanish).
134+
* The language of the documents stored in the collection. Permitted values include `en` (English), `de` (German), and
135+
* `es` (Spanish).
136136
*
137137
* @return the language
138138
*/
Collapse file

‎discovery/src/main/java/com/ibm/watson/developer_cloud/discovery/v1/model/CollectionDiskUsage.java‎

Copy file name to clipboardExpand all lines: discovery/src/main/java/com/ibm/watson/developer_cloud/discovery/v1/model/CollectionDiskUsage.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 IBM Corp. All Rights Reserved.
2+
* Copyright 2018 IBM Corp. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
Collapse file

‎discovery/src/main/java/com/ibm/watson/developer_cloud/discovery/v1/model/CollectionUsage.java‎

Copy file name to clipboardExpand all lines: discovery/src/main/java/com/ibm/watson/developer_cloud/discovery/v1/model/CollectionUsage.java
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 IBM Corp. All Rights Reserved.
2+
* Copyright 2018 IBM Corp. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -27,7 +27,7 @@ public class CollectionUsage extends GenericModel {
2727
/**
2828
* Gets the available.
2929
*
30-
* Number of active collections in the environment
30+
* Number of active collections in the environment.
3131
*
3232
* @return the available
3333
*/
@@ -38,7 +38,7 @@ public Long getAvailable() {
3838
/**
3939
* Gets the maximumAllowed.
4040
*
41-
* Total number of collections allowed in the environment
41+
* Total number of collections allowed in the environment.
4242
*
4343
* @return the maximumAllowed
4444
*/
Collapse file

‎discovery/src/main/java/com/ibm/watson/developer_cloud/discovery/v1/model/Configuration.java‎

Copy file name to clipboardExpand all lines: discovery/src/main/java/com/ibm/watson/developer_cloud/discovery/v1/model/Configuration.java
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 IBM Corp. All Rights Reserved.
2+
* Copyright 2018 IBM Corp. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -36,7 +36,7 @@ public class Configuration extends GenericModel {
3636
/**
3737
* Gets the configurationId.
3838
*
39-
* The unique identifier of the configuration
39+
* The unique identifier of the configuration.
4040
*
4141
* @return the configurationId
4242
*/
@@ -58,7 +58,7 @@ public String getName() {
5858
/**
5959
* Gets the created.
6060
*
61-
* The creation date of the configuration in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
61+
* The creation date of the configuration in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
6262
*
6363
* @return the created
6464
*/
@@ -69,7 +69,7 @@ public Date getCreated() {
6969
/**
7070
* Gets the updated.
7171
*
72-
* The timestamp of when the configuration was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
72+
* The timestamp of when the configuration was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
7373
*
7474
* @return the updated
7575
*/
Collapse file

‎discovery/src/main/java/com/ibm/watson/developer_cloud/discovery/v1/model/Conversions.java‎

Copy file name to clipboardExpand all lines: discovery/src/main/java/com/ibm/watson/developer_cloud/discovery/v1/model/Conversions.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 IBM Corp. All Rights Reserved.
2+
* Copyright 2018 IBM Corp. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at

0 commit comments

Comments
0 (0)
You are visitor 01402792 — 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.