code: func (api *API) CreateIndex(ctx context.Context, indexName string, options IndexOptions) (*Index, error) {
  	span, _ := tracing.StartSpanFromContext(ctx, "API.CreateIndex")
  	defer span.Finish()
  
  	if err := api.validate(apiCreateIndex); err != nil {
  		return nil, errors.Wrap(err, "validating api method")
  	}
  
  	// Create index.
  	index, err := api.holder.CreateIndex(indexName, options)
  	if err != nil {
  		return nil, errors.Wrap(err, "creating index")
  	}
  	// Send the create index message to all nodes.
  	err = api.server.SendSync(
  		&CreateIndexMessage{
  			Index: indexName,
  			Meta:  &options,
  		})
  	if err != nil {
  		return nil, errors.Wrap(err, "sending CreateIndex message")
  	}
  	api.holder.Stats.Count("createIndex", 1, 1.0)
  	return index, nil
  }
docs: // CreateIndex makes a new Pilosa index.