setting search schema

Ryan Zezeski rzezeski at basho.com
Tue Oct 16 09:45:48 EDT 2012


David,

Yes, Riak Search is not the most friendly thing to remotely control.

I know we warn against writing to the _rs_schema directly but I never did
care much for warnings.  I tested the following and it worked fine.  I
don't know Python.  The content-type isn't necessary but seemed like a good
thing to add.

curl -XPUT -H 'content-type: application/x-erlang' '
http://localhost:8091/riak/_rs_schema/test' --data-binary @test.schema

This is only half the problem.  If you have run show-schema even _once_ on
the bucket  you wish to change the schema for then the previous schema has
been stored in the local cache for that node.  In this case you need to run
`search-cmd clear-schema-cache`, that will clear the cache on _all_ nodes.
 I realize that is what you are trying to avoid but I don't see an easy way
around it.  If you know Erlang you could make a remsh connection but not
sure that is any less of a pain.

Note that show-schema will give you the impression the cache is correct but
show-schema shows you what is stored in KV and not what is in the cache.
 As of Riak Search 1.2.0 the set-schema command will clear the cache for
you.  I know, this is all kind of silly.  It should be easy.  It's not.

FWIW, before I worked for Basho and was running Riak Search at my previous
job I did use a script which set the various schemas and installed the
commit hooks.  All I needed was a one-time setup so it worked fine for me.

-Z
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20121016/2b39858b/attachment.html>


More information about the riak-users mailing list