@@ -97,6 +97,20 @@ func (s *SearchIndexAdminServer) CreateIndex(ctx context.Context, in *admin_sear
9797 return nil , s .errorHandler .NewSearchServiceNotAvailableStatus (err , in .Name ).Err ()
9898 } else if errors .Is (err , cbsearchx .ErrIndexExists ) {
9999 return nil , s .errorHandler .NewSearchIndexExistsStatus (err , in .Name ).Err ()
100+ } else if errors .Is (err , cbsearchx .ErrIndexNameInvalid ) {
101+ return nil , s .errorHandler .NewSearchIndexNameInvalidStatus (err , in .Name ).Err ()
102+ } else if errors .Is (err , cbsearchx .ErrIndexNameTooLong ) {
103+ return nil , s .errorHandler .NewSearchIndexNameTooLongStatus (err , in .Name ).Err ()
104+ } else if errors .Is (err , cbsearchx .ErrIndexNameEmpty ) {
105+ return nil , s .errorHandler .NewSearchIndexNameEmptyStatus (err ).Err ()
106+ } else if errors .Is (err , cbsearchx .ErrUnknownIndexType ) {
107+ return nil , s .errorHandler .NewUnknownSearchIndexTypeStatus (err , in .Name , in .Type ).Err ()
108+ } else if errors .Is (err , cbsearchx .ErrOnlyBucketOrScopeSet ) {
109+ return nil , s .errorHandler .NewOnlyBucketOrScopeSetStatus (err , in .Name ).Err ()
110+ } else if errors .Is (err , cbsearchx .ErrSourceTypeIncorrect ) {
111+ return nil , s .errorHandler .NewIncorrectSearchSourceTypeStatus (err , in .Name , in .SourceType ).Err ()
112+ } else if errors .Is (err , cbsearchx .ErrSourceNotFound ) {
113+ return nil , s .errorHandler .NewSearchSourceNotFoundStatus (err , in .Name , in .SourceName ).Err ()
100114 }
101115 return nil , s .errorHandler .NewGenericStatus (err ).Err ()
102116 }
@@ -189,6 +203,20 @@ func (s *SearchIndexAdminServer) UpdateIndex(ctx context.Context, in *admin_sear
189203 return nil , s .errorHandler .NewSearchIndexMissingStatus (err , in .Index .Name ).Err ()
190204 } else if errors .Is (err , cbsearchx .ErrIndexExists ) {
191205 return nil , s .errorHandler .NewSearchUUIDMismatchStatus (err , in .Index .Name ).Err ()
206+ } else if errors .Is (err , cbsearchx .ErrIndexNameInvalid ) {
207+ return nil , s .errorHandler .NewSearchIndexNameInvalidStatus (err , in .Index .Name ).Err ()
208+ } else if errors .Is (err , cbsearchx .ErrIndexNameTooLong ) {
209+ return nil , s .errorHandler .NewSearchIndexNameTooLongStatus (err , in .Index .Name ).Err ()
210+ } else if errors .Is (err , cbsearchx .ErrIndexNameEmpty ) {
211+ return nil , s .errorHandler .NewSearchIndexNameEmptyStatus (err ).Err ()
212+ } else if errors .Is (err , cbsearchx .ErrOnlyBucketOrScopeSet ) {
213+ return nil , s .errorHandler .NewOnlyBucketOrScopeSetStatus (err , in .Index .Name ).Err ()
214+ } else if errors .Is (err , cbsearchx .ErrUnknownIndexType ) {
215+ return nil , s .errorHandler .NewUnknownSearchIndexTypeStatus (err , in .Index .Name , in .Index .Type ).Err ()
216+ } else if errors .Is (err , cbsearchx .ErrSourceTypeIncorrect ) {
217+ return nil , s .errorHandler .NewIncorrectSearchSourceTypeStatus (err , in .Index .Name , in .Index .SourceType ).Err ()
218+ } else if errors .Is (err , cbsearchx .ErrSourceNotFound ) {
219+ return nil , s .errorHandler .NewSearchSourceNotFoundStatus (err , in .Index .Name , in .Index .SourceName ).Err ()
192220 }
193221 return nil , s .errorHandler .NewGenericStatus (err ).Err ()
194222 }
@@ -232,6 +260,10 @@ func (s *SearchIndexAdminServer) DeleteIndex(ctx context.Context, in *admin_sear
232260 return nil , s .errorHandler .NewSearchServiceNotAvailableStatus (err , in .Name ).Err ()
233261 } else if errors .Is (err , cbsearchx .ErrIndexNotFound ) {
234262 return nil , s .errorHandler .NewSearchIndexMissingStatus (err , in .Name ).Err ()
263+ } else if errors .Is (err , cbsearchx .ErrIndexNameEmpty ) {
264+ return nil , s .errorHandler .NewSearchIndexNameEmptyStatus (err ).Err ()
265+ } else if errors .Is (err , cbsearchx .ErrOnlyBucketOrScopeSet ) {
266+ return nil , s .errorHandler .NewOnlyBucketOrScopeSetStatus (err , in .Name ).Err ()
235267 }
236268 return nil , s .errorHandler .NewGenericStatus (err ).Err ()
237269 }
@@ -275,6 +307,10 @@ func (s *SearchIndexAdminServer) GetIndex(ctx context.Context, in *admin_search_
275307 return nil , s .errorHandler .NewSearchServiceNotAvailableStatus (err , in .Name ).Err ()
276308 } else if errors .Is (err , cbsearchx .ErrIndexNotFound ) {
277309 return nil , s .errorHandler .NewSearchIndexMissingStatus (err , in .Name ).Err ()
310+ } else if errors .Is (err , cbsearchx .ErrIndexNameEmpty ) {
311+ return nil , s .errorHandler .NewSearchIndexNameEmptyStatus (err ).Err ()
312+ } else if errors .Is (err , cbsearchx .ErrOnlyBucketOrScopeSet ) {
313+ return nil , s .errorHandler .NewOnlyBucketOrScopeSetStatus (err , in .Name ).Err ()
278314 }
279315 return nil , s .errorHandler .NewGenericStatus (err ).Err ()
280316 }
@@ -308,6 +344,8 @@ func (s *SearchIndexAdminServer) ListIndexes(ctx context.Context, in *admin_sear
308344 if err != nil {
309345 if errors .Is (err , gocbcorex .ErrServiceNotAvailable ) {
310346 return nil , s .errorHandler .NewSearchServiceNotAvailableStatus (err , "" ).Err ()
347+ } else if errors .Is (err , cbsearchx .ErrOnlyBucketOrScopeSet ) {
348+ return nil , s .errorHandler .NewOnlyBucketOrScopeSetStatus (err , "" ).Err ()
311349 }
312350 return nil , s .errorHandler .NewGenericStatus (err ).Err ()
313351 }
@@ -349,6 +387,10 @@ func (s *SearchIndexAdminServer) AnalyzeDocument(ctx context.Context, in *admin_
349387 return nil , s .errorHandler .NewSearchServiceNotAvailableStatus (err , in .Name ).Err ()
350388 } else if errors .Is (err , cbsearchx .ErrIndexNotFound ) {
351389 return nil , s .errorHandler .NewSearchIndexMissingStatus (err , in .Name ).Err ()
390+ } else if errors .Is (err , cbsearchx .ErrIndexNameEmpty ) {
391+ return nil , s .errorHandler .NewSearchIndexNameEmptyStatus (err ).Err ()
392+ } else if errors .Is (err , cbsearchx .ErrOnlyBucketOrScopeSet ) {
393+ return nil , s .errorHandler .NewOnlyBucketOrScopeSetStatus (err , in .Name ).Err ()
352394 }
353395 return nil , s .errorHandler .NewGenericStatus (err ).Err ()
354396 }
@@ -384,6 +426,10 @@ func (s *SearchIndexAdminServer) GetIndexedDocumentsCount(ctx context.Context, i
384426 return nil , s .errorHandler .NewSearchServiceNotAvailableStatus (err , in .Name ).Err ()
385427 } else if errors .Is (err , cbsearchx .ErrIndexNotFound ) {
386428 return nil , s .errorHandler .NewSearchIndexMissingStatus (err , in .Name ).Err ()
429+ } else if errors .Is (err , cbsearchx .ErrIndexNameEmpty ) {
430+ return nil , s .errorHandler .NewSearchIndexNameEmptyStatus (err ).Err ()
431+ } else if errors .Is (err , cbsearchx .ErrOnlyBucketOrScopeSet ) {
432+ return nil , s .errorHandler .NewOnlyBucketOrScopeSetStatus (err , in .Name ).Err ()
387433 }
388434 return nil , s .errorHandler .NewGenericStatus (err ).Err ()
389435 }
@@ -418,6 +464,10 @@ func (s *SearchIndexAdminServer) PauseIndexIngest(ctx context.Context, in *admin
418464 return nil , s .errorHandler .NewSearchServiceNotAvailableStatus (err , in .Name ).Err ()
419465 } else if errors .Is (err , cbsearchx .ErrIndexNotFound ) {
420466 return nil , s .errorHandler .NewSearchIndexMissingStatus (err , in .Name ).Err ()
467+ } else if errors .Is (err , cbsearchx .ErrIndexNameEmpty ) {
468+ return nil , s .errorHandler .NewSearchIndexNameEmptyStatus (err ).Err ()
469+ } else if errors .Is (err , cbsearchx .ErrOnlyBucketOrScopeSet ) {
470+ return nil , s .errorHandler .NewOnlyBucketOrScopeSetStatus (err , in .Name ).Err ()
421471 }
422472 return nil , s .errorHandler .NewGenericStatus (err ).Err ()
423473 }
@@ -450,6 +500,10 @@ func (s *SearchIndexAdminServer) ResumeIndexIngest(ctx context.Context, in *admi
450500 return nil , s .errorHandler .NewSearchServiceNotAvailableStatus (err , in .Name ).Err ()
451501 } else if errors .Is (err , cbsearchx .ErrIndexNotFound ) {
452502 return nil , s .errorHandler .NewSearchIndexMissingStatus (err , in .Name ).Err ()
503+ } else if errors .Is (err , cbsearchx .ErrIndexNameEmpty ) {
504+ return nil , s .errorHandler .NewSearchIndexNameEmptyStatus (err ).Err ()
505+ } else if errors .Is (err , cbsearchx .ErrOnlyBucketOrScopeSet ) {
506+ return nil , s .errorHandler .NewOnlyBucketOrScopeSetStatus (err , in .Name ).Err ()
453507 }
454508 return nil , s .errorHandler .NewGenericStatus (err ).Err ()
455509 }
@@ -482,6 +536,10 @@ func (s *SearchIndexAdminServer) AllowIndexQuerying(ctx context.Context, in *adm
482536 return nil , s .errorHandler .NewSearchServiceNotAvailableStatus (err , in .Name ).Err ()
483537 } else if errors .Is (err , cbsearchx .ErrIndexNotFound ) {
484538 return nil , s .errorHandler .NewSearchIndexMissingStatus (err , in .Name ).Err ()
539+ } else if errors .Is (err , cbsearchx .ErrIndexNameEmpty ) {
540+ return nil , s .errorHandler .NewSearchIndexNameEmptyStatus (err ).Err ()
541+ } else if errors .Is (err , cbsearchx .ErrOnlyBucketOrScopeSet ) {
542+ return nil , s .errorHandler .NewOnlyBucketOrScopeSetStatus (err , in .Name ).Err ()
485543 }
486544 return nil , s .errorHandler .NewGenericStatus (err ).Err ()
487545 }
@@ -514,6 +572,10 @@ func (s *SearchIndexAdminServer) DisallowIndexQuerying(ctx context.Context, in *
514572 return nil , s .errorHandler .NewSearchServiceNotAvailableStatus (err , in .Name ).Err ()
515573 } else if errors .Is (err , cbsearchx .ErrIndexNotFound ) {
516574 return nil , s .errorHandler .NewSearchIndexMissingStatus (err , in .Name ).Err ()
575+ } else if errors .Is (err , cbsearchx .ErrIndexNameEmpty ) {
576+ return nil , s .errorHandler .NewSearchIndexNameEmptyStatus (err ).Err ()
577+ } else if errors .Is (err , cbsearchx .ErrOnlyBucketOrScopeSet ) {
578+ return nil , s .errorHandler .NewOnlyBucketOrScopeSetStatus (err , in .Name ).Err ()
517579 }
518580 return nil , s .errorHandler .NewGenericStatus (err ).Err ()
519581 }
@@ -546,6 +608,10 @@ func (s *SearchIndexAdminServer) FreezeIndexPlan(ctx context.Context, in *admin_
546608 return nil , s .errorHandler .NewSearchServiceNotAvailableStatus (err , in .Name ).Err ()
547609 } else if errors .Is (err , cbsearchx .ErrIndexNotFound ) {
548610 return nil , s .errorHandler .NewSearchIndexMissingStatus (err , in .Name ).Err ()
611+ } else if errors .Is (err , cbsearchx .ErrIndexNameEmpty ) {
612+ return nil , s .errorHandler .NewSearchIndexNameEmptyStatus (err ).Err ()
613+ } else if errors .Is (err , cbsearchx .ErrOnlyBucketOrScopeSet ) {
614+ return nil , s .errorHandler .NewOnlyBucketOrScopeSetStatus (err , in .Name ).Err ()
549615 }
550616 return nil , s .errorHandler .NewGenericStatus (err ).Err ()
551617 }
@@ -578,6 +644,10 @@ func (s *SearchIndexAdminServer) UnfreezeIndexPlan(ctx context.Context, in *admi
578644 return nil , s .errorHandler .NewSearchServiceNotAvailableStatus (err , in .Name ).Err ()
579645 } else if errors .Is (err , cbsearchx .ErrIndexNotFound ) {
580646 return nil , s .errorHandler .NewSearchIndexMissingStatus (err , in .Name ).Err ()
647+ } else if errors .Is (err , cbsearchx .ErrIndexNameEmpty ) {
648+ return nil , s .errorHandler .NewSearchIndexNameEmptyStatus (err ).Err ()
649+ } else if errors .Is (err , cbsearchx .ErrOnlyBucketOrScopeSet ) {
650+ return nil , s .errorHandler .NewOnlyBucketOrScopeSetStatus (err , in .Name ).Err ()
581651 }
582652 return nil , s .errorHandler .NewGenericStatus (err ).Err ()
583653 }
0 commit comments