Beispiel #1
0
func storeBucketProperties(cluster *riak.Cluster) error {
	cmd, err := riak.NewStoreBucketPropsCommandBuilder().
		WithBucketType("animals").
		WithBucket("cats").
		WithSearchIndex("famous").
		Build()
	if err != nil {
		return err
	}

	return cluster.Execute(cmd)
}
func InitIndexBucket(cluster *riak.Cluster, bucket string) {
	cmd, err := riak.NewStoreBucketPropsCommandBuilder().
		WithBucket(bucket).
		WithAllowMult(true).
		Build()
	if err != nil {
		logError("initIndexBucket", "Error creating command for setting up bucket for \"allow_mult\"", err.Error())
	}
	if err = cluster.Execute(cmd); err != nil {
		logError("initIndexBucket", "Error setting up bucket for \"allow_mult\"", err.Error())
	}
}
Beispiel #3
0
func deleteIndex(cluster *riak.Cluster) error {
	cmd, err := riak.NewStoreBucketPropsCommandBuilder().
		WithBucketType("animals").
		WithBucket("cats").
		WithSearchIndex("_dont_index_").
		Build()
	if err != nil {
		return err
	}

	if err := cluster.Execute(cmd); err != nil {
		return err
	}

	cmd, err = riak.NewDeleteIndexCommandBuilder().
		WithIndexName("famous").
		Build()
	if err != nil {
		return err
	}

	return cluster.Execute(cmd)
}