@@ -134,7 +134,7 @@ message SearchRequestBody {
134134 optional TrackHits track_total_hits = 7 ;
135135
136136 // [optional] Values used to boost the score of specified indexes. Specify in the format of <index> : <boost-multiplier>
137- map <string , float > indices_boost = 8 ;
137+ map <string , float > indices_boost = 8 [ deprecated = true ] ;
138138
139139 // [optional] The fields that OpenSearch should return using their docvalue forms. Specify a format to return results in a certain format, such as date and time.
140140 repeated FieldAndFormat docvalue_fields = 9 ;
@@ -210,6 +210,12 @@ message SearchRequestBody {
210210
211211 // [optional]
212212 map <string , DerivedField > derived = 35 ;
213+
214+ // Defines the aggregations that are run as part of the search request.
215+ map <string , AggregationContainer > aggregations = 36 ;
216+
217+ // [optional] Values used to boost the score of specified indexes. Specify in the format of <index> : <boost-multiplier>
218+ repeated FloatMap indices_boost_2 = 37 ;
213219}
214220
215221message DerivedField {
@@ -286,6 +292,8 @@ message SearchResponse {
286292
287293 // [optional] If the query was terminated early, the terminated_early flag will be set to true in the response
288294 optional bool terminated_early = 13 ;
295+
296+ map <string , Aggregate > aggregations = 14 ;
289297}
290298
291299message ProcessorExecutionDetail {
@@ -2908,6 +2916,93 @@ message ShardSearchFailure {
29082916 ErrorCause reason = 4 ;
29092917}
29102918
2919+ message Aggregate {
2920+
2921+ optional MaxAggregate max = 1 ;
2922+
2923+ optional MinAggregate min = 2 ;
2924+ }
2925+
2926+ message AggregationContainer {
2927+
2928+ // Custom metadata to associate with the aggregation (optional)
2929+ optional ObjectMap meta = 1 ;
2930+ oneof aggregation_container {
2931+ MaxAggregation max = 2 ;
2932+
2933+ MinAggregation min = 3 ;
2934+
2935+ }
2936+ }
2937+
2938+ message FloatMap {
2939+
2940+ map <string , float > float_map = 1 ;
2941+ }
2942+
2943+ message MaxAggregate {
2944+
2945+ // The custom metadata attached to a resource.
2946+ optional ObjectMap meta = 1 ;
2947+
2948+ SingleMetricAggregateBaseAllOfValue value = 2 ;
2949+
2950+ optional string value_as_string = 3 ;
2951+ }
2952+
2953+ message MaxAggregation {
2954+
2955+ // Custom metadata to associate with the aggregation (optional)
2956+ optional ObjectMap meta = 1 ;
2957+
2958+ optional FieldValue missing = 2 ;
2959+
2960+ // The path to a field or an array of paths. Some APIs support wildcards in the path, which allows you to select multiple fields.
2961+ optional string field = 3 ;
2962+
2963+ optional Script script = 4 ;
2964+
2965+ optional string format = 5 ;
2966+
2967+ optional ValueType value_type = 6 ;
2968+ }
2969+
2970+ message MinAggregate {
2971+
2972+ // The custom metadata attached to a resource.
2973+ optional ObjectMap meta = 1 ;
2974+
2975+ SingleMetricAggregateBaseAllOfValue value = 2 ;
2976+
2977+ optional string value_as_string = 3 ;
2978+ }
2979+
2980+ message MinAggregation {
2981+
2982+ // Custom metadata to associate with the aggregation (optional)
2983+ optional ObjectMap meta = 1 ;
2984+
2985+ optional FieldValue missing = 2 ;
2986+
2987+ // The path to a field or an array of paths. Some APIs support wildcards in the path, which allows you to select multiple fields.
2988+ optional string field = 3 ;
2989+
2990+ optional Script script = 4 ;
2991+
2992+ optional string format = 5 ;
2993+
2994+ optional ValueType value_type = 6 ;
2995+ }
2996+
2997+ message SingleMetricAggregateBaseAllOfValue {
2998+ oneof single_metric_aggregate_base_all_of_value {
2999+ double double = 1 ;
3000+
3001+ NullValue null_value = 2 ;
3002+
3003+ }
3004+ }
3005+
29113006enum FieldValueFactorModifier {
29123007 FIELD_VALUE_FACTOR_MODIFIER_UNSPECIFIED = 0 ;
29133008 FIELD_VALUE_FACTOR_MODIFIER_LN = 1 ;
@@ -3243,6 +3338,23 @@ enum SimpleQueryStringFlag {
32433338 SIMPLE_QUERY_STRING_FLAG_WHITESPACE = 13 ;
32443339}
32453340
3341+ enum ValueType {
3342+ VALUE_TYPE_UNSPECIFIED = 0 ;
3343+ VALUE_TYPE_BOOLEAN = 1 ;
3344+ VALUE_TYPE_BYTE = 2 ;
3345+ VALUE_TYPE_DATE = 3 ;
3346+ VALUE_TYPE_DOUBLE = 4 ;
3347+ VALUE_TYPE_FLOAT = 5 ;
3348+ VALUE_TYPE_INTEGER = 6 ;
3349+ VALUE_TYPE_IP = 7 ;
3350+ VALUE_TYPE_LONG = 8 ;
3351+ VALUE_TYPE_NUMBER = 9 ;
3352+ VALUE_TYPE_NUMERIC = 10 ;
3353+ VALUE_TYPE_SHORT = 11 ;
3354+ VALUE_TYPE_STRING = 12 ;
3355+ VALUE_TYPE_UNSIGNED_LONG = 13 ;
3356+ }
3357+
32463358message ObjectMap {
32473359 map <string , Value > fields = 1 ;
32483360
0 commit comments