@@ -317,23 +317,6 @@ message IndexDocumentRequest {
317317 optional SourceType source_type = 16 ;
318318}
319319
320- // The response from index document request
321- message IndexDocumentResponse {
322- oneof response {
323- // Index document success response
324- IndexDocumentResponseBody index_document_response_body = 1 ;
325- // Index document failure response
326- IndexDocumentErrorResponse index_document_error_response = 2 ;
327- }
328- }
329-
330- // The error response from index document request
331- message IndexDocumentErrorResponse {
332- // [optional]
333- optional Error error = 1 ;
334- // [optional] HTTP response status code
335- optional int32 status = 2 ;
336- }
337320
338321enum Result {
339322 RESULT_UNSPECIFIED = 0 ;
@@ -344,7 +327,8 @@ enum Result {
344327 RESULT_UPDATED = 5 ;
345328}
346329
347- message IndexDocumentResponseBody {
330+ // The response from index document request
331+ message IndexDocumentResponse {
348332 // [optional] The document type.
349333 optional string x_type = 1 ;
350334 // [optional] The document's ID.
@@ -359,7 +343,7 @@ message IndexDocumentResponseBody {
359343 // [optional] The sequence number assigned when the document was indexed.
360344 optional int64 x_seq_no = 6 ;
361345 // [optional] Detailed information about the cluster's shards.
362- ShardStatistics x_shards = 7 ;
346+ optional ShardStatistics x_shards = 7 ;
363347 // [optional] The document's version.
364348 optional int64 x_version = 8 ;
365349 // [optional] if `true`, it requires immediate visibility of the document
@@ -393,7 +377,8 @@ message DeleteDocumentRequest {
393377 optional WaitForActiveShards wait_for_active_shards = 10 ;
394378}
395379
396- message DeleteDocumentResponseBody {
380+ // The response from delete index document with Id request
381+ message DeleteDocumentResponse {
397382 // [optional] The document type.
398383 optional string x_type = 1 ;
399384 // [optional] The document's ID.
@@ -415,21 +400,6 @@ message DeleteDocumentResponseBody {
415400
416401}
417402
418- // The response from delete index document with Id request
419- message DeleteDocumentResponse {
420- oneof response {
421- DeleteDocumentResponseBody delete_document_response_body = 1 ;
422- DeleteDocumentErrorResponse delete_document_error_response = 2 ;
423- }
424- }
425- // The error response from delete index document with Id request
426- message DeleteDocumentErrorResponse {
427- // [optional]
428- optional Error error = 1 ;
429- // [optional] HTTP response status code
430- optional int32 status = 2 ;
431- }
432-
433403// Update index document with Id request
434404message UpdateDocumentRequest {
435405 // [optional] Unique identifier for the document.
@@ -507,20 +477,6 @@ message UpdateDocumentRequestBody {
507477
508478// The response from update index document with Id request
509479message UpdateDocumentResponse {
510- oneof response {
511- UpdateDocumentResponseBody update_document_response_body = 1 ;
512- UpdateDocumentErrorResponse update_document_error_response = 2 ;
513- }
514- }
515- // The error response from update index document with Id request
516- message UpdateDocumentErrorResponse {
517- // [optional]
518- optional Error error = 1 ;
519- // [optional] HTTP response status code
520- optional int32 status = 2 ;
521- }
522-
523- message UpdateDocumentResponseBody {
524480 // [optional] The document type.
525481 optional string x_type = 1 ;
526482 // [optional] The document's ID.
@@ -577,13 +533,14 @@ message GetDocumentRequest {
577533 optional SourceType source_type = 13 ;
578534}
579535
580- message GetDocumentResponseBody {
536+ // The response from get document request with document ID specified request
537+ message GetDocumentResponse {
581538 // [optional] The document type.
582539 optional string x_type = 1 ;
583540 // [optional] The name of the index.
584541 optional string x_index = 2 ;
585542 // [optional] Contains the document's data that's stored in the index. Only returned if both stored_fields and found are true.
586- ObjectMap fields = 3 ;
543+ optional ObjectMap fields = 3 ;
587544 // [optional] Whether the document exists.
588545 optional bool found = 4 ;
589546 // [optional] The document's ID.
@@ -607,18 +564,3 @@ message GetDocumentResponseBody {
607564 // [optional] The document's version number. Updated whenever the document changes.
608565 optional int64 x_version = 10 ;
609566}
610-
611- // The response from get document request with document ID specified request
612- message GetDocumentResponse {
613- oneof response {
614- GetDocumentResponseBody get_document_response_body = 1 ;
615- GetDocumentErrorResponse get_document_error_response = 2 ;
616- }
617- }
618- // The error response from get document request with document ID specified request
619- message GetDocumentErrorResponse {
620- // [optional]
621- optional Error error = 1 ;
622- // [optional] HTTP response status code
623- optional int32 status = 2 ;
624- }
0 commit comments