Skip to content

Commit ba30839

Browse files
committed
chore(discovery2): Apply manual changes
1 parent 0f19b82 commit ba30839

File tree

3 files changed

+18
-19
lines changed

3 files changed

+18
-19
lines changed

src/IBM.WatsonDeveloperCloud.Discovery.v1/DiscoveryService.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,19 +1623,19 @@ public QueryResponse FederatedQuery(string environmentId, List<string> collectio
16231623
Passages = passages,
16241624
Aggregation = aggregation,
16251625
Count = count,
1626-
ReturnFields = returnFields,
1626+
ReturnFields = (returnFields == null || returnFields.Count < 1) ? null : string.Join(", ", returnFields.ToArray()),
16271627
Offset = offset,
1628-
Sort = sort,
1628+
Sort = (sort == null || sort.Count < 1) ? null : string.Join(", ", sort.ToArray()),
16291629
Highlight = highlight,
1630-
PassagesFields = passagesFields,
1630+
PassagesFields = (passagesFields == null || passagesFields.Count < 1) ? null : string.Join(", ", passagesFields.ToArray()),
16311631
PassagesCount = passagesCount,
16321632
PassagesCharacters = passagesCharacters,
16331633
Deduplicate = deduplicate,
16341634
DeduplicateField = deduplicateField,
1635-
CollectionIds = collectionIds,
1635+
CollectionIds = (collectionIds == null || collectionIds.Count < 1) ? null : string.Join(", ", collectionIds.ToArray()),
16361636
Similar = similar,
1637-
SimilarDocumentIds = similarDocumentIds,
1638-
SimilarFields = similarFields,
1637+
SimilarDocumentIds = (similarDocumentIds == null || similarDocumentIds.Count < 1) ? null : string.Join(", ", similarDocumentIds.ToArray()),
1638+
SimilarFields = (similarFields == null || similarFields.Count < 1) ? null : string.Join(", ", similarFields.ToArray()),
16391639
Bias = bias
16401640
};
16411641

@@ -1878,18 +1878,18 @@ public QueryResponse Query(string environmentId, string collectionId, string fil
18781878
Passages = passages,
18791879
Aggregation = aggregation,
18801880
Count = count,
1881-
ReturnFields = returnFields,
1881+
ReturnFields = (returnFields == null || returnFields.Count < 1) ? null : string.Join(", ", returnFields.ToArray()),
18821882
Offset = offset,
1883-
Sort = sort,
1883+
Sort = (sort == null || sort.Count < 1) ? null : string.Join(", ", sort.ToArray()),
18841884
Highlight = highlight,
1885-
PassagesFields = passagesFields,
1885+
PassagesFields = (passagesFields == null || passagesFields.Count < 1) ? null : string.Join(", ", passagesFields.ToArray()),
18861886
PassagesCount = passagesCount,
18871887
PassagesCharacters = passagesCharacters,
18881888
Deduplicate = deduplicate,
18891889
DeduplicateField = deduplicateField,
18901890
Similar = similar,
1891-
SimilarDocumentIds = similarDocumentIds,
1892-
SimilarFields = similarFields,
1891+
SimilarDocumentIds = (similarDocumentIds == null || similarDocumentIds.Count < 1) ? null : string.Join(", ", similarDocumentIds.ToArray()),
1892+
SimilarFields = (similarFields == null || similarFields.Count < 1) ? null : string.Join(", ", similarFields.ToArray()),
18931893
Bias = bias
18941894
};
18951895

src/IBM.WatsonDeveloperCloud.Discovery.v1/Model/EventData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class EventData : BaseModel
4040
/// in the log was used.
4141
/// </summary>
4242
[JsonProperty("client_timestamp", NullValueHandling = NullValueHandling.Ignore)]
43-
public DateTime ClientTimestamp { get; set; }
43+
public DateTime? ClientTimestamp { get; set; }
4444
/// <summary>
4545
/// The rank of the result item which the event is associated with.
4646
/// </summary>

src/IBM.WatsonDeveloperCloud.Discovery.v1/Model/QueryLarge.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*
1616
*/
1717

18-
using System.Collections.Generic;
1918
using Newtonsoft.Json;
2019

2120
namespace IBM.WatsonDeveloperCloud.Discovery.v1.Model
@@ -65,7 +64,7 @@ public class QueryLarge : BaseModel
6564
/// A comma-separated list of the portion of the document hierarchy to return.
6665
/// </summary>
6766
[JsonProperty("return", NullValueHandling = NullValueHandling.Ignore)]
68-
public List<string> ReturnFields { get; set; }
67+
public string ReturnFields { get; set; }
6968
/// <summary>
7069
/// The number of query results to skip at the beginning. For example, if the total number of results that are
7170
/// returned is 10 and the offset is 8, it returns the last two results.
@@ -78,7 +77,7 @@ public class QueryLarge : BaseModel
7877
/// no prefix is specified. This parameter cannot be used in the same query as the **bias** parameter.
7978
/// </summary>
8079
[JsonProperty("sort", NullValueHandling = NullValueHandling.Ignore)]
81-
public List<string> Sort { get; set; }
80+
public string Sort { get; set; }
8281
/// <summary>
8382
/// When true, a highlight field is returned for each result which contains the fields which match the query
8483
/// with `<em></em>` tags around the matching query terms.
@@ -90,7 +89,7 @@ public class QueryLarge : BaseModel
9089
/// top-level fields are included.
9190
/// </summary>
9291
[JsonProperty("passages.fields", NullValueHandling = NullValueHandling.Ignore)]
93-
public List<string> PassagesFields { get; set; }
92+
public string PassagesFields { get; set; }
9493
/// <summary>
9594
/// The maximum number of passages to return. The search returns fewer passages if the requested total is not
9695
/// found. The default is `10`. The maximum is `100`.
@@ -121,7 +120,7 @@ public class QueryLarge : BaseModel
121120
/// invalid when performing a single collection query.
122121
/// </summary>
123122
[JsonProperty("collection_ids", NullValueHandling = NullValueHandling.Ignore)]
124-
public List<string> CollectionIds { get; set; }
123+
public string CollectionIds { get; set; }
125124
/// <summary>
126125
/// When `true`, results are returned based on their similarity to the document IDs specified in the
127126
/// **similar.document_ids** parameter.
@@ -136,13 +135,13 @@ public class QueryLarge : BaseModel
136135
/// subsequently applied and reduce the scope.
137136
/// </summary>
138137
[JsonProperty("similar.document_ids", NullValueHandling = NullValueHandling.Ignore)]
139-
public List<string> SimilarDocumentIds { get; set; }
138+
public string SimilarDocumentIds { get; set; }
140139
/// <summary>
141140
/// A comma-separated list of field names that are used as a basis for comparison to identify similar documents.
142141
/// If not specified, the entire document is used for comparison.
143142
/// </summary>
144143
[JsonProperty("similar.fields", NullValueHandling = NullValueHandling.Ignore)]
145-
public List<string> SimilarFields { get; set; }
144+
public string SimilarFields { get; set; }
146145
/// <summary>
147146
/// Field which the returned results will be biased against. The specified field must be either a **date** or
148147
/// **number** format. When a **date** type field is specified returned results are biased towards field values

0 commit comments

Comments
 (0)