Optimistic Locking with Riak Search / is _version_ required in schema.xml?

Ryan Zezeski ryan at zinascii.com
Thu Aug 7 17:57:34 EDT 2014

On Aug 7, 2014, at 5:46 PM, David James <davidcjames at gmail.com> wrote:

> Is _version_ required?

It should not be required as the documentation says it is only needed for real-time GET which Riak Search (Yokozuna) disables since Riak KV provides the get/put implementation.
> I see SolrCloud mentioned in some documentation (see below)? Does Riak Search use it?

RS does not make use of SolrCloud at all.  It uses Solr’s Distributed Search but that is something that existed well before SolrCloud.  All routing and replica administration is handled by Riak.  Each Solr instance (one per node) has no awareness of the other nodes except for the explicit distributed queries sent by Riak.

> How does Riak Search handle optimistic locking?

It doesn’t use Solr’s optimistic locking at all.  All key-value semantics come from Riak itself.  RS simply indexes an object’s values.
> See this comment on the default_schema.xml on Github:
> <!-- TODO: is this needed? -->
> <field name="_version_" type="long" indexed="true" stored="true"/>
> https://raw.githubusercontent.com/basho/yokozuna/develop/priv/default_schema.xml

Yes, I wrote that TODO.  It is one of many that founds its way into 2.0.0 :).  You should run fine without this field if you create a custom schema.

> P.S. Per https://wiki.apache.org/solr/SchemaXml
> _version_  Solr4.0 - This field is used for optimistic locking in SolrCloud and it enables Real Time Get. If you remove it you must also remove the transaction logging from solrconfig.xml, see Real Time Get.

Just to reiterate what I said above, RS disables the transaction logging and thus there is no real time get.  There is no reason for it since that is what Riak itself provides.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20140807/e0da895b/attachment.html>

More information about the riak-users mailing list