// DeleteIndex removes the named index. If the index is not found it does
// nothing and returns no error.
DeleteIndex removes the named index. If the index is not found it does
nothing and returns no error.
// DeleteIndex removes the named index . If the index is not found it does // nothing and returns no error .
func (api *API) DeleteIndex(ctx context.Context, indexName string) error {
	span, _ := tracing.StartSpanFromContext(ctx, "API.DeleteIndex")
	defer span.Finish()
	if err := api.validate(apiDeleteIndex); err != nil {
		return errors.Wrap(err, "validating api method")
	}
	err := api.holder.DeleteIndex(indexName)
	if err != nil {
		return errors.Wrap(err, "deleting index")
	}
	err = api.server.SendSync(
		&DeleteIndexMessage{
			Index: indexName,
		})
	if err != nil {
		api.server.logger.Printf("problem sending DeleteIndex message: %s", err)
		return errors.Wrap(err, "sending DeleteIndex message")
	}
	api.holder.Stats.Count("deleteIndex", 1, 1.0)
	return nil
}
func ( api * API ) DeleteIndex ( ctx context . Context , indexName string ) error { span , _ := tracing . StartSpanFromContext ( ctx , " " ) defer span . Finish ( ) if err := api . validate ( apiDeleteIndex ) ; err != nil { return errors . Wrap ( err , " " ) } err := api . holder . DeleteIndex ( indexName ) if err != nil { return errors . Wrap ( err , " " ) } err = api . server . SendSync ( & DeleteIndexMessage { Index : indexName , } ) if err != nil { api . server . logger . Printf ( " " , err ) return errors . Wrap ( err , " " ) } api . holder . Stats . Count ( " " , 1 , 1.0 ) return nil }
DeleteIndex removes the named index.
DeleteIndex removes the named index .
// Delete index from the holder. // Send the delete index message to all nodes.