Skip to content

Commit 0fe410c

Browse files
authored
Align manual proto with generated proto - Bulk (opensearch-project#151)
* Align manual proto with generated proto - bulkreques Signed-off-by: xil <fridalu66@gmail.com> * update * change responseItem * add annotation * fix * update --------- Signed-off-by: xil <fridalu66@gmail.com>
1 parent 7ed0812 commit 0fe410c

3 files changed

Lines changed: 189 additions & 148 deletions

File tree

CHANGELOG.md

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

1010
### Changed
1111
- Remove json_name annotations and prefix fields with `underscore_` ([#149](https://github.com/opensearch-project/opensearch-protobufs/pull/149))
12+
- Align manual proto with generated proto - bulk ([#151](https://github.com/opensearch-project/opensearch-protobufs/pull/151))
1213

1314
### Removed
1415

protos/schemas/common.proto

Lines changed: 71 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,27 @@ import "google/protobuf/struct.proto";
1212

1313
message WaitForActiveShards {
1414

15-
enum WaitForActiveShardOptions {
16-
WAIT_FOR_ACTIVE_SHARD_OPTIONS_UNSPECIFIED = 0;
17-
WAIT_FOR_ACTIVE_SHARD_OPTIONS_ALL = 1;
18-
}
19-
2015
oneof wait_for_active_shards {
2116
int32 int32_value = 1;
2217
WaitForActiveShardOptions wait_for_active_shard_options = 2;
2318
}
19+
}
20+
message WaitForActiveShardOptions {
2421

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+
}
2528
}
2629

2730
message Script {
2831
oneof script {
2932
// Defines an inline script to execute as part of a query.
30-
InlineScript inline_script = 1;
33+
InlineScript inline = 1;
3134
// References a stored script by its ID for use in a query.
32-
StoredScriptId stored_script_id = 2;
35+
StoredScriptId stored = 2;
3336
}
3437
}
3538

@@ -50,20 +53,59 @@ message InlineScript {
5053
}
5154

5255
message ScriptLanguage {
53-
enum BuiltinScriptLanguage {
54-
BUILTIN_SCRIPT_LANGUAGE_UNSPECIFIED = 0;
55-
BUILTIN_SCRIPT_LANGUAGE_EXPRESSION = 1;
56-
BUILTIN_SCRIPT_LANGUAGE_JAVA = 2;
57-
BUILTIN_SCRIPT_LANGUAGE_MUSTACHE = 3;
58-
BUILTIN_SCRIPT_LANGUAGE_PAINLESS = 4;
59-
}
60-
// [optional] Default is painless.
6156
oneof script_language {
62-
BuiltinScriptLanguage builtin_script_language = 1;
63-
string string_value = 2;
57+
BuiltinScriptLanguage builtin = 1;
58+
59+
string custom = 2;
60+
}
61+
}
62+
63+
enum BuiltinScriptLanguage {
64+
BUILTIN_SCRIPT_LANGUAGE_UNSPECIFIED = 0;
65+
BUILTIN_SCRIPT_LANGUAGE_EXPRESSION = 1;
66+
BUILTIN_SCRIPT_LANGUAGE_JAVA = 2;
67+
BUILTIN_SCRIPT_LANGUAGE_MUSTACHE = 3;
68+
BUILTIN_SCRIPT_LANGUAGE_PAINLESS = 4;
69+
}
70+
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;
6487
}
6588
}
6689

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+
}
97+
}
98+
99+
enum SuggestMode {
100+
SUGGEST_MODE_UNSPECIFIED = 0;
101+
// Use suggestions based on the provided terms
102+
SUGGEST_MODE_ALWAYS = 1;
103+
// Use suggestions for terms not in the index
104+
SUGGEST_MODE_MISSING = 2;
105+
// Use suggestions that have more occurrences
106+
SUGGEST_MODE_POPULAR = 3;
107+
}
108+
67109
message StoredScriptId {
68110
// [optional]
69111
// The parameters that can be passed to the script.
@@ -173,15 +215,22 @@ message StringOrStringArray {
173215
}
174216
}
175217

218+
219+
message Id {
220+
oneof id {
221+
NullValue null_value = 1;
222+
string string = 2;
223+
}
224+
}
225+
226+
176227
message SourceConfig {
177228

178229
oneof source_config{
179230
// [optional] if the source_config is bool value. true: The entire document source is returned. false: The document source is not returned.
180231
bool fetch = 1;
181-
// [optional] Array of patterns containing source fields to return.
182-
StringArray includes = 2;
183232
// [optional] source_filter type containing a list of source fields to include or exclude.
184-
SourceFilter filter = 3;
233+
SourceFilter filter = 2;
185234
}
186235

187236
}
@@ -238,8 +287,8 @@ message SourceFilter {
238287

239288
message ErrorCause {
240289

241-
// The type of error
242-
optional string type = 1;
290+
// [required] The type of error
291+
string type = 1;
243292

244293
// A human-readable explanation of the error, in english
245294
optional string reason = 2;

0 commit comments

Comments
 (0)