Associating a schema with a bucket?

Fyodor Yarochkin fyodor.y at armorize.com
Wed Aug 24 04:46:14 EDT 2011


On Wed, Aug 24, 2011 at 10:08 AM, Adam J. O'Donnell
<adam.j.odonnell at gmail.com> wrote:
> Hey guys
>
> I have been reading up on Riak, and it is not quite clear to me how
> you associate a schema for Solr with a given bucket.  I understand
> that you can associate a schema with an index name, but how does that
> tie back to a Riak KV bucket?

Correct me if I am wrong, but here is my observation:

from code:
riak_search_kv_hook.erl
-spec make_index(riak_object()) -> binary().
make_index(RiakObject) ->
    riak_object:bucket(RiakObject).

from doc: http://wiki.basho.com/Riak-Search---Schema.html
"..
The schema definition for an index is stored in the Riak bucket
_rs_schema, with a key of the same name as the index. For example, the
schema for the “books” index is stored under _rs_schema/books
.."

so I guess the Index name is basically your Riak KV bucket name. (and
pre-commit hook should be installed on that bucket).




More information about the riak-users mailing list