Skip to content

Commit 68bf9bf

Browse files
committed
feat(Discovery): Add spellingSuggestions param to QueryOptions
This only works on the Cloud Pak for Data version of Discovery
1 parent b03ebfe commit 68bf9bf

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryOptions.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public class QueryOptions extends GenericModel {
4040
private String similarDocumentIds;
4141
private String similarFields;
4242
private String bias;
43+
private Boolean spellingSuggestions;
4344
private Boolean xWatsonLoggingOptOut;
4445

4546
/**
@@ -67,6 +68,7 @@ public static class Builder {
6768
private String similarDocumentIds;
6869
private String similarFields;
6970
private String bias;
71+
private Boolean spellingSuggestions;
7072
private Boolean xWatsonLoggingOptOut;
7173

7274
private Builder(QueryOptions queryOptions) {
@@ -91,6 +93,7 @@ private Builder(QueryOptions queryOptions) {
9193
this.similarDocumentIds = queryOptions.similarDocumentIds;
9294
this.similarFields = queryOptions.similarFields;
9395
this.bias = queryOptions.bias;
96+
this.spellingSuggestions = queryOptions.spellingSuggestions;
9497
this.xWatsonLoggingOptOut = queryOptions.xWatsonLoggingOptOut;
9598
}
9699

@@ -351,6 +354,17 @@ public Builder bias(String bias) {
351354
return this;
352355
}
353356

357+
/**
358+
* Set the spellingSuggestions.
359+
*
360+
* @param spellingSuggestions the spellingSuggestions
361+
* @return the QueryOptions builder
362+
*/
363+
public Builder spellingSuggestions(Boolean spellingSuggestions) {
364+
this.spellingSuggestions = spellingSuggestions;
365+
return this;
366+
}
367+
354368
/**
355369
* Set the xWatsonLoggingOptOut.
356370
*
@@ -389,6 +403,7 @@ private QueryOptions(Builder builder) {
389403
similarDocumentIds = builder.similarDocumentIds;
390404
similarFields = builder.similarFields;
391405
bias = builder.bias;
406+
spellingSuggestions = builder.spellingSuggestions;
392407
xWatsonLoggingOptOut = builder.xWatsonLoggingOptOut;
393408
}
394409

@@ -655,6 +670,20 @@ public String bias() {
655670
return bias;
656671
}
657672

673+
/**
674+
* Gets the spellingSuggestions.
675+
*
676+
* When `true` and the **natural_language_query** parameter is used, the **natural_languge_query** parameter is spell
677+
* checked. The most likely correction is retunred in the **suggested_query** field of the response (if one exists).
678+
*
679+
* **Important:** this parameter is only valid when using the Cloud Pak version of Discovery.
680+
*
681+
* @return the spellingSuggestions
682+
*/
683+
public Boolean spellingSuggestions() {
684+
return spellingSuggestions;
685+
}
686+
658687
/**
659688
* Gets the xWatsonLoggingOptOut.
660689
*

0 commit comments

Comments
 (0)