// Index retrieves the named index.
Index retrieves the named index.
// Index retrieves the named index .
func (api *API) Index(ctx context.Context, indexName string) (*Index, error) {
	span, _ := tracing.StartSpanFromContext(ctx, "API.Index")
	defer span.Finish()
	if err := api.validate(apiIndex); err != nil {
		return nil, errors.Wrap(err, "validating api method")
	}
	index := api.holder.Index(indexName)
	if index == nil {
		return nil, newNotFoundError(ErrIndexNotFound)
	}
	return index, nil
}
func ( api * API ) Index ( ctx context . Context , indexName string ) ( * Index , error ) { span , _ := tracing . StartSpanFromContext ( ctx , " " ) defer span . Finish ( ) if err := api . validate ( apiIndex ) ; err != nil { return nil , errors . Wrap ( err , " " ) } index := api . holder . Index ( indexName ) if index == nil { return nil , newNotFoundError ( ErrIndexNotFound ) } return index , nil }
Index retrieves the named index.
Index retrieves the named index .