Skip to content

Commit 09c176b

Browse files
authored
Fix aggregations protos (opensearch-project#270)
Signed-off-by: Karen X <karenxyr@gmail.com>
1 parent c758869 commit 09c176b

2 files changed

Lines changed: 15 additions & 28 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
1010

1111
### Changed
1212
- Update preprocessing for x-protobuf-excluded ([#266](https://github.com/opensearch-project/opensearch-protobufs/pull/266))
13+
- Fix aggregations protos ([#270](https://github.com/opensearch-project/opensearch-protobufs/pull/270))
1314

1415
### Removed
1516
- Remove error responses for single doc ingestion APIS (Index, Update, Get, Delete Doc) ([#258](https://github.com/opensearch-project/opensearch-protobufs/pull/258))

protos/schemas/search.proto

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,24 +1140,21 @@ message CardinalityAggregation {
11401140
// [optional] The custom metadata attached to a resource.
11411141
optional ObjectMap meta = 1;
11421142

1143-
// [optional] Name of the aggregaton.
1144-
optional string name = 2;
1145-
11461143
// [optional] Field for which to calculate cardinality.
1147-
optional string field = 3;
1144+
optional string field = 2;
11481145

11491146
// [optional] If set documents missing the field are counted towards the cardinality total.
11501147
// Note the FieldValue provided here is arbitrary for the purposes of CardinalityAggregation.
1151-
optional FieldValue missing = 4;
1148+
optional FieldValue missing = 3;
11521149

11531150
// [optional] Script to be included in aggregation execution.
1154-
optional Script script = 5;
1151+
optional Script script = 4;
11551152

11561153
// [optional] A unique count below which counts are expected to be close to accurate. This allows to trade memory for accuracy.
1157-
optional int32 precision_threshold = 6;
1154+
optional int32 precision_threshold = 5;
11581155

1159-
// [optional] Execution hint to achieve higher performance given specific conditions.
1160-
optional CardinalityExecutionMode execution_hint = 7;
1156+
// [optional] Execution hint to achieve higher performance given specific conditions. Added in OpenSearch 2.19.1.
1157+
optional CardinalityExecutionMode execution_hint = 6;
11611158
}
11621159

11631160
message CardinalityAggregate {
@@ -1171,26 +1168,25 @@ message CardinalityAggregate {
11711168
enum CardinalityExecutionMode {
11721169
// OpenSearch will determine execution mode automatically when none specified.
11731170
CARDINALITY_EXECUTION_MODE_UNSPECIFIED = 0;
1174-
// Cardinality will be calculated by hasing the contents of each field.
1171+
// Cardinality will be calculated by hashing the contents of each field.
11751172
// Standard approach for high cardinality fields where field contents is not frequently repeated.
11761173
CARDINALITY_EXECUTION_MODE_DIRECT = 1;
11771174
// Cardinality will be calculated based on the global ordinals for this field.
11781175
// More memory efficient for low cardinality fields where global ordinals can be efficiently calculated.
11791176
CARDINALITY_EXECUTION_MODE_GLOBAL_ORDINALS = 2;
1177+
// Save memory by using a segmented approach for HLL structures (added in OpenSearch 2.19.1).
1178+
CARDINALITY_EXECUTION_MODE_SEGMENT_ORDINALS = 3;
11801179
}
11811180

11821181
message MissingAggregation {
11831182
// [optional] The custom metadata attached to a resource.
11841183
optional ObjectMap meta = 1;
11851184

1186-
// [optional] Name of the aggregaton.
1187-
optional string name = 2;
1188-
11891185
// [optional] Sub-aggregations for this bucket aggregation
1190-
map<string, AggregationContainer> aggregations = 3;
1186+
map<string, AggregationContainer> aggregations = 2;
11911187

11921188
// [optional] The path to a field or an array of paths. Some APIs support wildcards in the path, which allows you to select multiple fields.
1193-
optional string field = 5;
1189+
optional string field = 3;
11941190
}
11951191

11961192
message MissingAggregate {
@@ -1204,13 +1200,6 @@ message MissingAggregate {
12041200
map<string, Aggregate> aggregations = 3;
12051201
}
12061202

1207-
enum MissingOrder {
1208-
MISSING_ORDER_UNSPECIFIED = 0;
1209-
MISSING_ORDER_DEFAULT = 1;
1210-
MISSING_ORDER_FIRST = 2;
1211-
MISSING_ORDER_LAST = 3;
1212-
}
1213-
12141203
message StringMap {
12151204
map<string, string> string_map = 1;
12161205
}
@@ -1219,8 +1208,6 @@ message TermsAggregation {
12191208
// The custom metadata attached to a resource.
12201209
optional ObjectMap meta = 1;
12211210

1222-
optional string name = 2;
1223-
12241211
// Sub-aggregations for this bucket aggregation
12251212
map<string, AggregationContainer> aggregations = 3;
12261213

@@ -1243,10 +1230,6 @@ message TermsAggregation {
12431230

12441231
optional FieldValue missing = 11;
12451232

1246-
optional MissingOrder missing_order = 12;
1247-
1248-
optional bool missing_bucket = 13;
1249-
12501233
// Coerced unmapped fields into the specified type.
12511234
optional string value_type = 14;
12521235

@@ -1264,6 +1247,9 @@ message TermsAggregation {
12641247
optional int32 size = 19;
12651248

12661249
optional string format = 20;
1250+
1251+
// The minimum number of documents in a bucket on each shard for it to be returned.
1252+
optional int32 shard_min_doc_count = 21;
12671253
}
12681254

12691255
enum TermsAggregationCollectMode {

0 commit comments

Comments
 (0)