@@ -17,14 +17,10 @@ message WaitForActiveShards {
1717 WaitForActiveShardOptions wait_for_active_shard_options = 2 ;
1818 }
1919}
20- message WaitForActiveShardOptions {
21-
22- oneof wait_for_active_shard_options {
23- // Wait for all shards to be active.
24- bool wait_for_active_shard_options_all = 1 ;
25- // null represents the default value (which defaults to one shard copy).
26- NullValue null_value = 2 ;
27- }
20+ enum WaitForActiveShardOptions {
21+ WAIT_FOR_ACTIVE_SHARD_OPTIONS_UNSPECIFIED = 0 ;
22+ WAIT_FOR_ACTIVE_SHARD_OPTIONS_ALL = 1 ;
23+ WAIT_FOR_ACTIVE_SHARD_OPTIONS_NULL = 2 ;
2824}
2925
3026message Script {
@@ -68,32 +64,19 @@ enum BuiltinScriptLanguage {
6864 BUILTIN_SCRIPT_LANGUAGE_PAINLESS = 4 ;
6965}
7066
71- message ExpandWildcard {
72- oneof expand_wildcard {
73- // Match any index, including hidden ones.
74- bool expand_wildcard_all = 1 ;
75-
76- // Match closed, non-hidden indexes.
77- bool expand_wildcard_closed = 2 ;
78-
79- // Match hidden indexes. Must be combined with `open`, `closed`, or both.
80- bool expand_wildcard_hidden = 3 ;
81-
82- // Wildcard expressions are not accepted.
83- bool expand_wildcard_none = 4 ;
84-
85- // Match open, non-hidden indexes.
86- bool expand_wildcard_open = 5 ;
87- }
67+ enum ExpandWildcard {
68+ EXPAND_WILDCARD_UNSPECIFIED = 0 ;
69+ EXPAND_WILDCARD_ALL = 1 ;
70+ EXPAND_WILDCARD_CLOSED = 2 ;
71+ EXPAND_WILDCARD_HIDDEN = 3 ;
72+ EXPAND_WILDCARD_NONE = 4 ;
73+ EXPAND_WILDCARD_OPEN = 5 ;
8874}
8975
90- message SearchType {
91- oneof search_type {
92- // Documents are scored using global term and document frequencies across all shards. This is usually slower but more accurate.
93- bool search_type_dfs_query_then_fetch = 1 ;
94- // Documents are scored using local term and document frequencies for the shard. This is usually faster but less accurate.
95- bool search_type_query_then_fetch = 2 ;
96- }
76+ enum SearchType {
77+ SEARCH_TYPE_UNSPECIFIED = 0 ;
78+ SEARCH_TYPE_DFS_QUERY_THEN_FETCH = 1 ;
79+ SEARCH_TYPE_QUERY_THEN_FETCH = 2 ;
9780}
9881
9982enum SuggestMode {
@@ -585,14 +568,11 @@ message HighlighterType {
585568 }
586569}
587570
588- message BuiltinHighlighterType {
589- oneof builtin_highlighter_type {
590- bool builtin_highlighter_type_plain = 1 ;
591-
592- bool builtin_highlighter_type_fvh = 2 ;
593-
594- bool builtin_highlighter_type_unified = 3 ;
595- }
571+ enum BuiltinHighlighterType {
572+ BUILTIN_HIGHLIGHTER_TYPE_UNSPECIFIED = 0 ;
573+ BUILTIN_HIGHLIGHTER_TYPE_PLAIN = 1 ;
574+ BUILTIN_HIGHLIGHTER_TYPE_FVH = 2 ;
575+ BUILTIN_HIGHLIGHTER_TYPE_UNIFIED = 3 ;
596576}
597577
598578enum BoundaryScanner {
@@ -817,20 +797,12 @@ message FieldSort {
817797 optional string field = 8 ;
818798}
819799
820- message FieldSortNumericType {
821- oneof field_sort_numeric_type {
822- // The field contains date values.
823- bool field_sort_numeric_type_date = 1 ;
824-
825- // The field contains date values with nanosecond precision.
826- bool field_sort_numeric_type_date_nanos = 2 ;
827-
828- // The field contains double-precision floating-point values.
829- bool field_sort_numeric_type_double = 3 ;
830-
831- // The field contains long integer values.
832- bool field_sort_numeric_type_long = 4 ;
833- }
800+ enum FieldSortNumericType {
801+ FIELD_SORT_NUMERIC_TYPE_UNSPECIFIED = 0 ;
802+ FIELD_SORT_NUMERIC_TYPE_DATE = 1 ;
803+ FIELD_SORT_NUMERIC_TYPE_DATE_NANOS = 2 ;
804+ FIELD_SORT_NUMERIC_TYPE_DOUBLE = 3 ;
805+ FIELD_SORT_NUMERIC_TYPE_LONG = 4 ;
834806}
835807
836808enum FieldType {
@@ -907,33 +879,19 @@ enum SortOrder {
907879 SORT_ORDER_DESC = 2 ;
908880}
909881
910- message SortMode {
911- oneof sort_mode {
912- // Use the average of all values.
913- bool sort_mode_avg = 1 ;
914-
915- // Use the maximum value.
916- bool sort_mode_max = 2 ;
917-
918- // Use the median value.
919- bool sort_mode_median = 3 ;
920-
921- // Use the minimum value.
922- bool sort_mode_min = 4 ;
923-
924- // Use the sum of all values.
925- bool sort_mode_sum = 5 ;
926- }
882+ enum SortMode {
883+ SORT_MODE_UNSPECIFIED = 0 ;
884+ SORT_MODE_AVG = 1 ;
885+ SORT_MODE_MAX = 2 ;
886+ SORT_MODE_MEDIAN = 3 ;
887+ SORT_MODE_MIN = 4 ;
888+ SORT_MODE_SUM = 5 ;
927889}
928890
929- message GeoDistanceType {
930- oneof geo_distance_type {
931- // The arc calculation method uses great circle distance.
932- bool geo_distance_type_arc = 1 ;
933-
934- // The plane calculation method uses faster but less accurate flat-earth distance.
935- bool geo_distance_type_plane = 2 ;
936- }
891+ enum GeoDistanceType {
892+ GEO_DISTANCE_TYPE_UNSPECIFIED = 0 ;
893+ GEO_DISTANCE_TYPE_ARC = 1 ;
894+ GEO_DISTANCE_TYPE_PLANE = 2 ;
937895}
938896
939897message GeoDistanceSort {
@@ -964,28 +922,27 @@ enum GeoValidationMethod {
964922 GEO_VALIDATION_METHOD_STRICT = 3 ;
965923}
966924
967- message DistanceUnit {
968- oneof distance_unit {
969- bool distance_unit_cm = 1 ;
970-
971- bool distance_unit_ft = 2 ;
972-
973- bool distance_unit_in = 3 ;
974-
975- bool distance_unit_km = 4 ;
976-
977- bool distance_unit_m = 5 ;
978-
979- bool distance_unit_mi = 6 ;
980-
981- bool distance_unit_mm = 7 ;
982-
983- bool distance_unit_nmi = 8 ;
925+ enum DistanceUnit {
926+ DISTANCE_UNIT_UNSPECIFIED = 0 ;
927+ DISTANCE_UNIT_CM = 1 ;
928+ DISTANCE_UNIT_FT = 2 ;
929+ DISTANCE_UNIT_IN = 3 ;
930+ DISTANCE_UNIT_KM = 4 ;
931+ DISTANCE_UNIT_M = 5 ;
932+ DISTANCE_UNIT_MI = 6 ;
933+ DISTANCE_UNIT_MM = 7 ;
934+ DISTANCE_UNIT_NMI = 8 ;
935+ DISTANCE_UNIT_YD = 9 ;
936+ }
984937
985- bool distance_unit_yd = 9 ;
986- }
938+ enum ScriptSortType {
939+ SCRIPT_SORT_TYPE_UNSPECIFIED = 0 ;
940+ SCRIPT_SORT_TYPE_NUMBER = 1 ;
941+ SCRIPT_SORT_TYPE_STRING = 2 ;
942+ SCRIPT_SORT_TYPE_VERSION = 3 ;
987943}
988944
945+
989946message ScriptSort {
990947
991948 // [optional] Specifies the sort order (asc or dsc) for the score.
@@ -996,29 +953,8 @@ message ScriptSort {
996953
997954 // [optional] Specifies script sort type.
998955 ScriptSortType type = 3 ;
999- enum ScriptSortType {
1000- SCRIPT_SORT_TYPE_UNSPECIFIED = 0 ;
1001- SCRIPT_SORT_TYPE_NUMBER = 1 ;
1002- SCRIPT_SORT_TYPE_STRING = 2 ;
1003- SCRIPT_SORT_TYPE_VERSION = 3 ;
1004- }
1005-
1006956 // [optional] Specifies what array value should be chosen for sorting the document.
1007957 SortMode mode = 4 ;
1008- enum SortMode {
1009- SORT_MODE_UNSPECIFIED = 0 ;
1010- // Use the average of all values as sort value. Only applicable for number based array fields.
1011- SORT_MODE_AVG = 1 ;
1012- // Pick the highest value.
1013- SORT_MODE_MAX = 2 ;
1014- // Use the median of all values as sort value. Only applicable for number based array fields.
1015- SORT_MODE_MEDIAN = 3 ;
1016- // Pick the lowest value.
1017- SORT_MODE_MIN = 4 ;
1018- // Use the sum of all values as sort value. Only applicable for number based array fields.
1019- SORT_MODE_SUM = 5 ;
1020- }
1021-
1022958 // Supports sorting by fields that are inside one or more nested objects.
1023959 NestedSortValue nested = 5 ;
1024960
0 commit comments