-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(discovery-v1): document status & query aggregation update
DocumentStatus: documentID, status, and statusDescription are now optional. QueryAggregation: BREAKING QueryAggregation subclasses changed. BREAKING CHANGE: QueryAggregation: BREAKING QueryAggregation subclasses changed.
- Loading branch information
Showing
16 changed files
with
547 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
Scripts/Services/Discovery/V1/Model/QueryCalculationAggregation.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* (C) Copyright IBM Corp. 2022. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
using Newtonsoft.Json; | ||
|
||
namespace IBM.Watson.Discovery.V1.Model | ||
{ | ||
/// <summary> | ||
/// Returns a scalar calculation across all documents for the field specified. Possible calculations include min, | ||
/// max, sum, average, and unique_count. | ||
/// </summary> | ||
public class QueryCalculationAggregation : QueryAggregation | ||
{ | ||
/// <summary> | ||
/// The field to perform the calculation on. | ||
/// </summary> | ||
[JsonProperty("field", NullValueHandling = NullValueHandling.Ignore)] | ||
public string Field { get; set; } | ||
/// <summary> | ||
/// The value of the calculation. | ||
/// </summary> | ||
[JsonProperty("value", NullValueHandling = NullValueHandling.Ignore)] | ||
public double? Value { get; set; } | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
Scripts/Services/Discovery/V1/Model/QueryFilterAggregation.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* (C) Copyright IBM Corp. 2022. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
|
||
namespace IBM.Watson.Discovery.V1.Model | ||
{ | ||
/// <summary> | ||
/// A modifier that narrows the document set of the sub-aggregations it precedes. | ||
/// </summary> | ||
public class QueryFilterAggregation : QueryAggregation | ||
{ | ||
/// <summary> | ||
/// The filter that is written in Discovery Query Language syntax and is applied to the documents before | ||
/// sub-aggregations are run. | ||
/// </summary> | ||
[JsonProperty("match", NullValueHandling = NullValueHandling.Ignore)] | ||
public string Match { get; set; } | ||
/// <summary> | ||
/// Number of documents that match the filter. | ||
/// </summary> | ||
[JsonProperty("matching_results", NullValueHandling = NullValueHandling.Ignore)] | ||
public long? MatchingResults { get; set; } | ||
/// <summary> | ||
/// An array of sub-aggregations. | ||
/// </summary> | ||
[JsonProperty("aggregations", NullValueHandling = NullValueHandling.Ignore)] | ||
public List<QueryAggregation> Aggregations { get; set; } | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
Scripts/Services/Discovery/V1/Model/QueryHistogramAggregation.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* (C) Copyright IBM Corp. 2022. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
|
||
namespace IBM.Watson.Discovery.V1.Model | ||
{ | ||
/// <summary> | ||
/// Numeric interval segments to categorize documents by using field values from a single numeric field to describe | ||
/// the category. | ||
/// </summary> | ||
public class QueryHistogramAggregation : QueryAggregation | ||
{ | ||
/// <summary> | ||
/// The numeric field name used to create the histogram. | ||
/// </summary> | ||
[JsonProperty("field", NullValueHandling = NullValueHandling.Ignore)] | ||
public string Field { get; set; } | ||
/// <summary> | ||
/// The size of the sections that the results are split into. | ||
/// </summary> | ||
[JsonProperty("interval", NullValueHandling = NullValueHandling.Ignore)] | ||
public long? Interval { get; set; } | ||
/// <summary> | ||
/// Identifier specified in the query request of this aggregation. | ||
/// </summary> | ||
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)] | ||
public string Name { get; set; } | ||
/// <summary> | ||
/// Array of numeric intervals. | ||
/// </summary> | ||
[JsonProperty("results", NullValueHandling = NullValueHandling.Ignore)] | ||
public List<QueryHistogramAggregationResult> Results { get; set; } | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
Scripts/Services/Discovery/V1/Model/QueryHistogramAggregationResult.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* (C) Copyright IBM Corp. 2022. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
|
||
namespace IBM.Watson.Discovery.V1.Model | ||
{ | ||
/// <summary> | ||
/// Histogram numeric interval result. | ||
/// </summary> | ||
public class QueryHistogramAggregationResult | ||
{ | ||
/// <summary> | ||
/// The value of the upper bound for the numeric segment. | ||
/// </summary> | ||
[JsonProperty("key", NullValueHandling = NullValueHandling.Ignore)] | ||
public long? Key { get; set; } | ||
/// <summary> | ||
/// Number of documents with the specified key as the upper bound. | ||
/// </summary> | ||
[JsonProperty("matching_results", NullValueHandling = NullValueHandling.Ignore)] | ||
public long? MatchingResults { get; set; } | ||
/// <summary> | ||
/// An array of sub-aggregations. | ||
/// </summary> | ||
[JsonProperty("aggregations", NullValueHandling = NullValueHandling.Ignore)] | ||
public List<QueryAggregation> Aggregations { get; set; } | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
Scripts/Services/Discovery/V1/Model/QueryNestedAggregation.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* (C) Copyright IBM Corp. 2022. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
|
||
namespace IBM.Watson.Discovery.V1.Model | ||
{ | ||
/// <summary> | ||
/// A restriction that alters the document set that is used for sub-aggregations it precedes to nested documents | ||
/// found in the field specified. | ||
/// </summary> | ||
public class QueryNestedAggregation : QueryAggregation | ||
{ | ||
/// <summary> | ||
/// The path to the document field to scope sub-aggregations to. | ||
/// </summary> | ||
[JsonProperty("path", NullValueHandling = NullValueHandling.Ignore)] | ||
public string Path { get; set; } | ||
/// <summary> | ||
/// Number of nested documents found in the specified field. | ||
/// </summary> | ||
[JsonProperty("matching_results", NullValueHandling = NullValueHandling.Ignore)] | ||
public long? MatchingResults { get; set; } | ||
/// <summary> | ||
/// An array of sub-aggregations. | ||
/// </summary> | ||
[JsonProperty("aggregations", NullValueHandling = NullValueHandling.Ignore)] | ||
public List<QueryAggregation> Aggregations { get; set; } | ||
} | ||
} |
Oops, something went wrong.