Using UUID as keys is problematic for Riak Search

David James davidcjames at
Sun Aug 10 18:59:47 EDT 2014

I'm using UUIDs for keys in Riak -- converted to bytes, not UTF-8 strings.
(I'd rather spend 16 bytes for each key, not 36.)

As I understand it, Yokozuna maps the Riak key to _yz_id.

Here is the suggested schema from the documentation:

<!-- schema.xml -->
<field name="_yz_id" type="_yz_str" indexed="true" stored="true"
 multiValued="false" required="true"/>
<fieldType name="_yz_str" class="solr.StrField" sortMissingLast="true"/>

Would you expect this to work with Riak Search? I would hope so.

(Or must keys be UTF-8 strings?)

I get this error, which does not surprise me, given that the _yz_id is
defined as a string:

==> log/error.log <==

2014-08-10 18:24:16.221 [error] <0.610.0>@yz_kv:index:206 failed to index
with error {ucs,{bad_utf8_character_code}} because
I don't think changing the schema.xml type for _yz_id to "solr.UUIDField"
is a good idea.

What can I do?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the riak-users mailing list