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