code: func (api *API) CreateField(ctx context.Context, indexName string, fieldName string, opts ...FieldOption) (*Field, error) {
  	span, _ := tracing.StartSpanFromContext(ctx, "API.CreateField")
  	defer span.Finish()
  
  	if err := api.validate(apiCreateField); err != nil {
  		return nil, errors.Wrap(err, "validating api method")
  	}
  
  	// Apply functional options.
  	fo := FieldOptions{}
  	for _, opt := range opts {
  		err := opt(&fo)
  		if err != nil {
  			return nil, errors.Wrap(err, "applying option")
  		}
  	}
  
  	// Find index.
  	index := api.holder.Index(indexName)
  	if index == nil {
  		return nil, newNotFoundError(ErrIndexNotFound)
  	}
  
  	// Create field.
  	field, err := index.CreateField(fieldName, opts...)
  	if err != nil {
  		return nil, errors.Wrap(err, "creating field")
  	}
  
  	// Send the create field message to all nodes.
  	err = api.server.SendSync(
  		&CreateFieldMessage{
  			Index: indexName,
  			Field: fieldName,
  			Meta:  &fo,
  		})
  	if err != nil {
  		api.server.logger.Printf("problem sending CreateField message: %s", err)
  		return nil, errors.Wrap(err, "sending CreateField message")
  	}
  	api.holder.Stats.CountWithCustomTags("createField", 1, 1.0, []string{fmt.Sprintf("index:%s", indexName)})
  	return field, nil
  }
docs: // CreateField makes the named field in the named index with the given options.
  // This method currently only takes a single functional option, but that may be
  // changed in the future to support multiple options.