Skip to content

Commit bd70b87

Browse files
lucy66hwkarenyrx
andauthored
Modify searchResponse and bulkResponse according to the updated spec and remove the error response. (opensearch-project#194)
* Update search response Signed-off-by: xil <fridalu66@gmail.com> # Conflicts: # CHANGELOG.md * update Signed-off-by: xil <fridalu66@gmail.com> * add `bulkResponse` to changelog Signed-off-by: Karen X <karenxyr@gmail.com> --------- Signed-off-by: xil <fridalu66@gmail.com> Signed-off-by: Karen X <karenxyr@gmail.com> Co-authored-by: Karen X <karenxyr@gmail.com>
1 parent d7a108e commit bd70b87

3 files changed

Lines changed: 8 additions & 59 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
99
- proto Conversion Tooling support vendor extension `x-protobuf-excluded` ([#192](https://github.com/opensearch-project/opensearch-protobufs/pull/192))
1010

1111
### Changed
12-
- update `score` protobuf type ([#179](https://github.com/opensearch-project/opensearch-protobufs/pull/179))
1312
- Update `RangeQuery` and `NestedQuery` protobuf type ([#196](https://github.com/opensearch-project/opensearch-protobufs/pull/196))
13+
- Modify `searchResponse` and `bulkResponse` according to the updated spec and remove the error response. ([#194](https://github.com/opensearch-project/opensearch-protobufs/pull/194))
1414

1515
### Removed
1616

protos/schemas/document.proto

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -189,31 +189,14 @@ message DeleteOperation {
189189

190190
}
191191

192-
// Bulk response contains the individual results of each operation in the request, returned in the order submitted. The success or failure of an individual operation does not affect other operations in the request.
192+
// todo: Proposal Spec this name
193193
message BulkResponse {
194-
oneof response {
195-
// The bulk success response
196-
BulkResponseBody bulk_response_body = 1;
197-
// The bulk error response
198-
BulkErrorResponse bulk_error_response = 2;
199-
}
200-
}
201-
202-
message BulkErrorResponse {
203-
// [optional] The bulk error
204-
optional Error error = 1;
205-
// [optional] HTTP response status code
206-
optional int32 status = 2;
207-
}
208-
209-
message BulkResponseBody {
210-
211-
// [optional] If true, one or more of the operations in the bulk request did not complete successfully.
212-
optional bool errors = 1;
213-
// [optional] Contains the result of each operation in the bulk request, in the order they were submitted.
194+
// [required] If true, one or more of the operations in the bulk request did not complete successfully.
195+
bool errors = 1;
196+
// [required] Contains the result of each operation in the bulk request, in the order they were submitted.
214197
repeated Item items = 2;
215-
// [optional] How long, in milliseconds, it took to process the bulk request.
216-
optional int64 took = 3;
198+
// [required] How long, in milliseconds, it took to process the bulk request.
199+
int64 took = 3;
217200
// [optional] How long, in milliseconds, it took to process documents through an ingest pipeline
218201
optional int64 ingest_took = 4;
219202

protos/schemas/search.proto

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -293,40 +293,6 @@ message TrackHits {
293293

294294
// The response from search request.
295295
message SearchResponse {
296-
oneof response {
297-
// The search success response
298-
ResponseBody response_body = 1;
299-
// The search 4xx error response
300-
Error4xxResponseBody error_4xx_response = 2;
301-
// The search 5xx error response
302-
Error5xxResponse error_5xx_response = 3;
303-
}
304-
}
305-
306-
307-
308-
// The 4xx error response from search/index-search request.
309-
message Error4xxResponseBody {
310-
// [optional] The search 4xx error response body.
311-
Error error = 1;
312-
// [optional] The search 4xx error response status code.
313-
optional int32 status = 2;
314-
}
315-
316-
// The 5xx error response from search/index-search request.
317-
message Error5xxResponse {
318-
// [optional] The search 5xx error response status code.
319-
optional int32 status_code = 1;
320-
// [optional] The search 5xx error content.
321-
optional string error = 2;
322-
// [optional] The search 5xx error message.
323-
optional string message = 3;
324-
// [optional] The search 5xx error additional_details.
325-
.google.protobuf.Struct additional_details = 4;
326-
}
327-
//
328-
//// The response body from a search/index-search request.
329-
message ResponseBody {
330296

331297
// [required] Milliseconds it took Elasticsearch to execute the request.
332298
int64 took = 1;
@@ -368,7 +334,7 @@ message ResponseBody {
368334
optional bool terminated_early = 13;
369335
// [optional]
370336
// todo: not supported yet
371-
// map<string, SearchResultSuggestValueInnerArray> suggest = 14;
337+
// map<string, SuggestArray> suggest = 14;
372338
}
373339

374340
message ProcessorExecutionDetail {

0 commit comments

Comments
 (0)