code: func (api *API) DeleteView(ctx context.Context, indexName string, fieldName string, viewName string) error {
  	span, _ := tracing.StartSpanFromContext(ctx, "API.DeleteView")
  	defer span.Finish()
  
  	if err := api.validate(apiDeleteView); err != nil {
  		return errors.Wrap(err, "validating api method")
  	}
  
  	// Retrieve field.
  	f := api.holder.Field(indexName, fieldName)
  	if f == nil {
  		return ErrFieldNotFound
  	}
  
  	// Delete the view.
  	if err := f.deleteView(viewName); err != nil {
  		// Ignore this error because views do not exist on all nodes due to shard distribution.
  		if err != ErrInvalidView {
  			return errors.Wrap(err, "deleting view")
  		}
  	}
  
  	// Send the delete view message to all nodes.
  	err := api.server.SendSync(
  		&DeleteViewMessage{
  			Index: indexName,
  			Field: fieldName,
  			View:  viewName,
  		})
  	if err != nil {
  		api.server.logger.Printf("problem sending DeleteView message: %s", err)
  	}
  
  	return errors.Wrap(err, "sending DeleteView message")
  }
docs: // DeleteView removes the given view.