{"id":264242,"date":"2015-08-25T14:57:04","date_gmt":"2015-08-25T10:57:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=264242"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=264242","title":{"rendered":"Riak \u0438 Riak Search. \u041f\u0435\u0440\u0432\u043e\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e"},"content":{"rendered":"<p>             <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/459\/f23\/cff\/459f23cff564449389a03f1f2093226e.png\"\/><\/p>\n<p>  \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0432 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0446\u0435\u043b\u044f\u0445 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u0431\u0430\u0437\u0435 Riak \u0432\u0435\u0440\u0441\u0438\u0438 2.1.1 \u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e \u043d\u0438\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Riak Search (Yokozuna). \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <a href=\"https:\/\/github.com\/basho\/riak-erlang-client\/\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442 \u0434\u043b\u044f Erlang<\/a>.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u0430\u043a\u0438\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432:  <\/p>\n<ul>\n<li>title \u2014 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a;<\/li>\n<li>body \u2014 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435;<\/li>\n<li>tags \u2014 \u0442\u044d\u0433\u0438;<\/li>\n<li>created_at \u2014 \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f;<\/li>\n<li>smiles \u2014 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043c\u0430\u0439\u043b\u0438\u043a\u043e\u0432 (\u043f\u043b\u044e\u0441\u0438\u043a\u043e\u0432, \u043b\u0430\u0439\u043a\u043e\u0432, \u043a\u0430\u043a \u0445\u043e\u0442\u0438\u0442\u0435)<\/li>\n<\/ul>\n<p>  \u0438 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c. \u041a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043d\u0430\u0447\u043d\u0451\u043c.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u042f \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u044e, \u0447\u0442\u043e \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438 \u0443\u0436\u0435 \u0438\u043c\u0435\u044e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e Riak. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"http:\/\/eax.me\/riak\/\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0438 <a href=\"http:\/\/habrahabr.ru\/post\/75202\/\">\u0442\u0443\u0442<\/a>, \u0438\u043b\u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, <a href=\"http:\/\/docs.basho.com\/riak\/latest\/\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e<\/a>.<\/p>\n<h3>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430<\/h3>\n<p>  \u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Riak Search \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 Java. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0430\u043c Riak \u0432 OSX \u043c\u043e\u0436\u043d\u043e \u0447\u0435\u0440\u0435\u0437 Homebrew, \u0430 Erlang, \u0435\u0441\u043b\u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f, \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438:  <\/p>\n<pre><code class=\"bash\">brew install riak <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0443\u0447\u0435\u0431\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0439 \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0446\u0435\u043b\u044b\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c\u0441\u044f \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0438\u043c \u0443\u0437\u043b\u043e\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043b\u0438\u0448\u044c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443. \u0412 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 \u043d\u0443\u0436\u043d\u043e \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c Riak Search:  <\/p>\n<pre><code class=\"bash\">## To enable Search set this 'on'. ## ## Default: off ## ## Acceptable values: ##   - on or off search = on <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 Riak \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Homebrew, \u0442\u043e \u043a\u043e\u043d\u0444\u0438\u0433 \u043b\u0435\u0436\u0438\u0442 \u0437\u0434\u0435\u0441\u044c \u2014 \/usr\/local\/Cellar\/riak\/2.1.1\/libexec\/etc\/riak.conf<\/p>\n<p>  \u0415\u0449\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u043b\u0438\u043c\u0438\u0442 \u043d\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435. \u0412 OSX Yosemite \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"bash\">echo kern.maxfiles=65536 &gt;&gt; \/etc\/sysctl.conf echo kern.maxfilesperproc=65536 &gt;&gt; \/etc\/sysctl.conf sudo sysctl -w kern.maxfiles=65536 sudo sysctl -w kern.maxfilesperproc=65536 echo ulimit -n 65536 65536 &gt;&gt; ~\/.bash_profile ulimit -n 65536 65536 <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c Riak:  <\/p>\n<pre><code class=\"bash\">riak console <\/code><\/pre>\n<p>  \u0418 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0439 shell-\u0441\u0435\u0441\u0441\u0438\u0438:  <\/p>\n<pre><code class=\"bash\">riak-admin test <\/code><\/pre>\n<p>  \u041e\u0442\u0432\u0435\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0438\u043c: Successfully completed 1 read\/write cycle to &#8216;riak@127.0.0.1&#8217;<\/p>\n<h4>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445:<\/h4>\n<p>  <\/p>\n<ul>\n<li><a href=\"http:\/\/eax.me\/riak-install\/\">\u0417\u0430\u043f\u0438\u0441\u043a\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u2014 \u041f\u0430\u043c\u044f\u0442\u043a\u0430 \u043f\u043e Riak<\/a>;<\/li>\n<li><a href=\"http:\/\/docs.basho.com\/riak\/latest\/quickstart\/\">Riak Docs \u2014 Five-Minute Install<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<h3>Riak Data Types<\/h3>\n<p>  Eventually Consistent \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430, \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f Riak, \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u044e\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0435 \u0442.\u043d. Data Incostistent \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439, \u043a\u043e\u0433\u0434\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u043a\u043b\u044e\u0447\u0430 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0445 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f. \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a, Riak \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0440\u0435\u0448\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u044b \u0441\u0430\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e vector clocks \u0438\u043b\u0438 timestamps, \u0438\u043b\u0438 \u0436\u0435 \u043f\u0435\u0440\u0435\u043b\u043e\u0436\u0438\u0442\u044c \u043e\u0431\u044f\u0437\u0430\u043d\u043d\u043e\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0432 \u0435\u043c\u0443 \u0432\u0441\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u0435\u0441\u044f \u0432\u0435\u0440\u0441\u0438\u0438 (siblings). \u0412 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u0435\u0441\u043b\u0438 \u0432\u0430\u0448\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u0438 \u0440\u0435\u043f\u043b\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0437\u043b\u043e\u0432, \u043c\u0435\u0440\u0434\u0436 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u0432\u0435\u0441\u044c\u043c\u0430 \u043d\u0435\u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043b\u0443\u0447\u0448\u0438\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Riak Data Types (\u0442\u0430\u043a\u0436\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u043a\u0430\u043a <abbr title=\"Convergent Replicated Data Types\">CRDT<\/abbr>). \u042d\u0442\u0430 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u0437\u044c\u043c\u0443\u0442 \u043d\u0430 \u0441\u0435\u0431\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043a\u043e\u043d\u0432\u0435\u0440\u0433\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0438 \u043e\u0441\u0432\u043e\u0431\u043e\u0434\u044f\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u0442 \u043e\u0431\u044f\u0437\u0430\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044e \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432.<\/p>\n<p>  Riak Data Types, \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u044f\u0442\u044c \u0442\u0438\u043f\u043e\u0432 CRDT:  <\/p>\n<ul>\n<li>flag \u2014 \u0411\u0438\u0442\u043e\u0432\u044b\u0439 \u0444\u043b\u0430\u0433. \u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u2014 \u0441\u043d\u044f\u0442\u044c, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c. \u041c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043d\u0443\u0442\u0440\u0438 map;<\/li>\n<li>counter \u2014 \u0421\u0447\u0451\u0442\u0447\u0438\u043a. \u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u2014 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c, \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c. \u0422\u043e\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043d\u0443\u0442\u0440\u0438 map;<\/li>\n<li>register \u2014 \u041a\u0430\u043a\u043e\u0435-\u043b\u0438\u0431\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 (\u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043a\u0430\u043a \u0441\u0442\u0440\u043e\u043a\u0430);<\/li>\n<li>set \u2014 \u041c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. \u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u2014 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442;<\/li>\n<li>map \u2014 \u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0442\u0438\u043f\u043e\u0432. \u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u0431\u044f \u0444\u043b\u0430\u0433\u0438, \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0438, \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b, \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0438 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 map&#8217;\u044b. \u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u2014 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u0435, \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u043e\u043b\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u043f\u043e\u043b\u0435\u0439, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0438\u0445 \u0442\u0438\u043f\u0430\u043c<\/li>\n<\/ul>\n<p>  \u0412 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441 \u044d\u0442\u0438\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438, \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0430\u0448\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u043a\u0430\u043a map \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439:  <\/p>\n<ul>\n<li>title \u2014 register;<\/li>\n<li>tags \u2014 set;<\/li>\n<li>body \u2014 register;<\/li>\n<li>created_at \u2014 register;<\/li>\n<li>smiles \u2014 counter<\/li>\n<\/ul>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0438 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u043c bucket-type \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c documents-type \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0438\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432:  <\/p>\n<pre><code class=\"bash\">riak-admin bucket-type create documents-type '{&quot;props&quot;:{&quot;datatype&quot;:&quot;map&quot;}}' riak-admin bucket-type activate documents-type <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043f\u043e Eventually Consistent, Riak Data Types \u0438 CRDT:<\/h4>\n<p>  <\/p>\n<ul>\n<li><a href=\"http:\/\/docs.basho.com\/riak\/latest\/theory\/concepts\/Eventual-Consistency\/\">Riak Docs \u2014 Eventual Consistency<\/a>;<\/li>\n<li><a href=\"http:\/\/docs.basho.com\/riak\/latest\/dev\/using\/conflict-resolution\/\">Riak Docs \u2014 Conflict Resolution<\/a>;<\/li>\n<li><a href=\"http:\/\/docs.basho.com\/riak\/latest\/theory\/concepts\/crdts\/\">Riak Docs \u2014 Data Types<\/a>;<\/li>\n<li><a href=\"http:\/\/hal.upmc.fr\/file\/index\/docid\/555588\/filename\/techreport.pdf\">A comprehensive study of<br \/>  Convergent and Commutative Replicated Data Types \u2014 Shapiro, Pregui\u00e7a, Baquero, and Zawirski<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<h3>Riak Search<\/h3>\n<p>  \u041c\u044b \u0445\u043e\u0442\u0438\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u043d\u0430\u0448\u0438\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e \u0442\u044d\u0433\u0430\u043c, \u043f\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0443, \u043f\u043e \u0434\u0430\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u043f\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u043c\u0443. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044e Riak Search \u043f\u043e\u0434 \u043a\u043e\u0434\u043e\u0432\u044b\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c Yokozuna, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e \u0441\u0432\u043e\u0435\u0439 \u0441\u0443\u0442\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0440\u0435\u0434\u043d\u0438\u043a\u043e\u043c \u043c\u0435\u0436\u0434\u0443 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435\u043c Riak \u0438 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0438\u043a\u043e\u043c <a href=\"http:\/\/lucene.apache.org\/solr\/\">Apache Solr<\/a>. Yokuzuna \u0441\u0430\u043c\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0438 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0443\u0437\u043b\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 JVM-\u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441 Solr, \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u0435\u043c\u0443 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b Solr \u0437\u043d\u0430\u043b \u043a\u0430\u043a \u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0443\u044e \u0441\u0445\u0435\u043c\u0443. \u0412\u043e\u043e\u0431\u0449\u0435 Riak Search \u0438\u043c\u0435\u0435\u0442 \u0438 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u043d\u0430 \u0432\u0441\u0435 \u0441\u043b\u0443\u0447\u0430\u0438 \u0436\u0438\u0437\u043d\u0438 \u2014 <a href=\"https:\/\/raw.github.com\/basho\/yokozuna\/develop\/priv\/default_schema.xml\">_yz_default<\/a>, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043b\u0443\u0447\u0448\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u044e.<\/p>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0445\u0435\u043c\u0443 \u0441\u0440\u0430\u0437\u0443. \u0412 \u0441\u0445\u0435\u043c\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u043f\u043e\u043b\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430, \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043d\u0438\u0445 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u0438\u043f, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043b\u0438 \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u043e \u043d\u0435\u043c\u0443 \u0438\u043d\u0434\u0435\u043a\u0441 \u0438 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0442\u043e\u043c \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0438\u0445 \u0432 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u043e\u0439 \u0432\u044b\u0434\u0430\u0447\u0435. \u0422\u0430\u043a\u0436\u0435 \u0432 \u0441\u0445\u0435\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0435 \u043f\u043e\u043b\u044f Riak Search. \u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e, \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 Riak Data Types, \u043a \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f\u043c \u043f\u043e\u043b\u0435\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0443\u0444\u0444\u0438\u043a\u0441, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0438\u0445 \u0442\u0438\u043f\u0443. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435:  <\/p>\n<pre><code class=\"xml\">    &lt;field name=&quot;title_register&quot; type=&quot;string&quot; indexed=&quot;true&quot; stored=&quot;false&quot; multiValued=&quot;fase&quot; \/&gt;     &lt;field name=&quot;body_register&quot; type=&quot;text_ru&quot; indexed=&quot;true&quot; stored=&quot;false&quot; multiValued=&quot;true&quot; \/&gt;     &lt;field name=&quot;tags_set&quot; type=&quot;string&quot; indexed=&quot;true&quot; stored=&quot;false&quot; multiValued=&quot;true&quot; \/&gt;     &lt;field name=&quot;created_at_register&quot; type=&quot;tdate&quot; indexed=&quot;true&quot; stored=&quot;false&quot; multiValued=&quot;false&quot; omitNorms=&quot;true&quot; \/&gt; <\/code><\/pre>\n<p>  \u041f\u043e\u0434 \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u043e\u043c \u043f\u043e\u043b\u043d\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 \u0441\u043e \u0441\u0445\u0435\u043c\u043e\u0439:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">docs_seacrh_schema.xml<\/b><\/p>\n<div class=\"spoiler_text\">&lt;?xml version=\u00ab1.0\u00bb encoding=\u00abUTF-8\u00bb ?&gt;<br \/>    \/&gt;<br \/>   \/&gt;<br \/>   \/&gt;<br \/>   \/&gt;<\/p>\n<p>   \/&gt;<\/p>\n<p>   \/&gt;<br \/>   \/&gt;<br \/>   \/&gt;<br \/>   \/&gt;<br \/>   \/&gt;<br \/>   \/&gt;<br \/>   \/&gt;<br \/>   \/&gt;<br \/>   \/&gt;<\/p>\n<p>  _yz_id<\/p>\n<p>   \/&gt;<br \/>   \/&gt;<\/p>\n<p>    \/&gt;<br \/>   \/&gt;<br \/>   \/&gt;<br \/>   \/&gt;<\/p>\n<p>  \/&gt;<\/p>\n<p>   \/&gt;<\/p>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<h4>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043f\u043e Riak Search:<\/h4>\n<p>  <\/p>\n<ul>\n<li><a href=\"http:\/\/docs.basho.com\/riak\/latest\/dev\/using\/search\/\">Riak Docs \u2014 Using Search<\/a>;<\/li>\n<li><a href=\"http:\/\/docs.basho.com\/riak\/latest\/dev\/advanced\/search\/\">Riak Docs \u2014 Search Details<\/a>;<\/li>\n<li><a href=\"http:\/\/docs.basho.com\/riak\/latest\/dev\/search\/search-data-types\/\">Riak Docs \u2014 Riak Data Types and Search<\/a>;<\/li>\n<li><a href=\"http:\/\/docs.basho.com\/riak\/latest\/dev\/advanced\/search-schema\/\">Riak Docs \u2014 Search Schema<\/a>;<\/li>\n<li><a href=\"https:\/\/cwiki.apache.org\/confluence\/display\/solr\/Documents%2C+Fields%2C+and+Schema+Design\">Apache Solr Reference Guide \u2014 Documents, Fields, and Schema Design<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<h3>\u0414\u043e\u0441\u0442\u0443\u043f \u043a Riak \u0438\u0437 Erlang<\/h3>\n<p>  \u041f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u043d\u0430\u0448\u0435\u0439 \u043d\u043e\u0434\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0434\u043b\u044f Erlang:  <\/p>\n<pre><code class=\"bash\"># \u0441\u043a\u0430\u0447\u0430\u0435\u043c \u0438 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c \u043a\u043b\u0438\u0435\u043d\u0442: git clone https:\/\/github.com\/basho\/riak-erlang-client.git cd riak-erlang-client\/ make cd .. # \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c REPL: erl -pa riak-erlang-client\/ebin riak-erlang-client\/deps\/*\/ebin <\/code><\/pre>\n<p>  \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f  <\/p>\n<pre><code class=\"erlang_repl\">{ok, RiakPid} = riakc_pb_socket:start_link(&quot;127.0.0.1&quot;, 8087). % \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 pong = riakc_pb_socket:ping(RiakPid). <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u0438 \u0438\u043d\u0434\u0435\u043a\u0441  <\/p>\n<pre><code class=\"erlang_repl\">{ok, Schema} = file:read_file(&quot;docs_search_schema.xml&quot;). ok = riakc_pb_socket:create_search_schema(RiakPid, &lt;&lt;&quot;documents-schema&quot;&gt;&gt;, Schema). ok = riakc_pb_socket:create_search_index(RiakPid, &lt;&lt;&quot;documents-index&quot;&gt;&gt;, &lt;&lt;&quot;documents-schema&quot;&gt;&gt;, []). <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0451\u043c bucket \u0438 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u043c \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441  <\/p>\n<pre><code class=\"erlang_repl\">ok = riakc_pb_socket:set_search_index(RiakPid, {&lt;&lt;&quot;documents-type&quot;&gt;&gt;, &lt;&lt;&quot;documents-bucket&quot;&gt;&gt;}, &lt;&lt;&quot;documents-index&quot;&gt;&gt;). <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043d\u043e\u0432\u044b\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442  <\/p>\n<pre><code class=\"erlang_repl\">Map = riakc_map:new().  % \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 - \u0440\u0435\u0433\u0438\u0441\u0442\u0440 (register) Map1 = riakc_map:update({&lt;&lt;&quot;title&quot;&gt;&gt;, register},                         fun(Reg) -&gt;                             riakc_register:set(&lt;&lt;&quot;DocumentTitle&quot;&gt;&gt;, Reg)                         end,                         Map).  % \u0422\u0435\u043b\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 - \u0442\u043e\u0436\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 (register) Map2 = riakc_map:update({&lt;&lt;&quot;body&quot;&gt;&gt;, register},                         fun(Reg) -&gt;                             riakc_register:set(&lt;&lt;&quot;Some Document Body&quot;&gt;&gt;, Reg)                         end,                         Map1).  % \u0422\u044d\u0433\u0438 - \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e (set) Map3 = riakc_map:update({&lt;&lt;&quot;tags&quot;&gt;&gt;, set},                         fun(Set) -&gt;                             Set1 = riakc_set:add_element(&lt;&lt;&quot;Tag One&quot;&gt;&gt;, Set),                             Set2 = riakc_set:add_element(&lt;&lt;&quot;Tag Two&quot;&gt;&gt;, Set1),                             Set2                         end,                         Map2).  % \u0414\u0430\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f - \u0440\u0435\u0433\u0438\u0441\u0442\u0440 (register) Map4 = riakc_map:update({&lt;&lt;&quot;created_at&quot;&gt;&gt;, register},                         fun(Reg) -&gt;                             % C\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u0447\u0442\u043e Solr \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0430\u0442\u044b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 ISO8601.                             % https:\/\/cwiki.apache.org\/confluence\/display\/solr\/Working+with+Dates.                             ISODateFmtStr = &quot;~4.10.0B-~2.10.0B-~2.10.0BT~2.10.0B:~2.10.0B:~2.10.0BZ&quot;,                             {{Year, Month, Day}, {Hour, Min, Sec}} = calendar:universal_time(),                             ISODate = list_to_binary(io_lib:format(ISODateFmtStr, [Year, Month, Day, Hour, Min, Sec])),                              riakc_register:set(ISODate, Reg)                         end,                         Map3).  % \u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043d\u0430\u0448\u0435\u0433\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 MapOperations = riakc_map:to_op(Map4). ok = riakc_pb_socket:update_type(RiakPid, {&lt;&lt;&quot;documents-type&quot;&gt;&gt;, &lt;&lt;&quot;documents-bucket&quot;&gt;&gt;}, &lt;&lt;&quot;DocumentKey&quot;&gt;&gt;, MapOperations). <\/code><\/pre>\n<p>  \u041d\u0430\u0445\u043e\u0434\u0438\u043c \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b  <\/p>\n<pre><code class=\"erlang_repl\">% \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0435\u0439 Riak Client. rr(&quot;riak-erlang-client\/include\/riakc.hrl&quot;).  % \u041f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0443 \u0442\u044d\u0433\u0443, \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u043c\u0443 \u0438 \u0434\u0430\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f {ok, Results} = riakc_pb_socket:search(RiakPid, &lt;&lt;&quot;documents-index&quot;&gt;&gt;, &lt;&lt;&quot;title_register:DocumentTitle AND tags_set:\\&quot;Tag One\\&quot; AND body_register:Some AND created_at_register:[1972-05-20T17:33:18Z TO NOW]&quot;&gt;&gt;).  % \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 Docs = Results#search_results.docs. lists:foldr(fun({_Index, Doc}, Acc) -&gt;                 {_, DocumentId} = lists:keyfind(&lt;&lt;&quot;_yz_rk&quot;&gt;&gt;, 1, Doc),                 {ok, {map, Image, _, _, _}} = riakc_pb_socket:fetch_type(RiakPid, {&lt;&lt;&quot;documents-type&quot;&gt;&gt;, &lt;&lt;&quot;documents-bucket&quot;&gt;&gt;}, DocumentId),                 Image             end,             [],             Docs). <\/code><\/pre>\n<p>  \u041c\u0435\u043d\u044f\u0435\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442  <\/p>\n<pre><code class=\"erlang_repl\">riakc_pb_socket:modify_type(RiakPid, fun(Map) -&gt;                                          % \u041e\u0431\u043d\u043e\u0432\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435                                          UpdatedMap1 = riakc_map:update({&lt;&lt;&quot;body&quot;&gt;&gt;, register},                                                                  fun(Register) -&gt;                                                                      riakc_register:set(&lt;&lt;&quot;\u041d\u043e\u0432\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435&quot;&gt;&gt;, Register)                                                                  end, Map),                                           % \u0423\u0434\u0430\u043b\u0438\u043c \u0442\u044d\u0433                                          UpdatedMap2 = riakc_map:update({&lt;&lt;&quot;tags&quot;&gt;&gt;, set},                                                                  fun(Set) -&gt;                                                                      riakc_set:del_element(&lt;&lt;&quot;Tag One&quot;&gt;&gt;, Set)                                                                  end, UpdatedMap1),                                           % \u0414\u043e\u0431\u0430\u0432\u0438\u043c 10 \u0441\u043c\u0430\u0439\u043b\u0438\u043a\u043e\u0432                                          UpdatedMap3 = riakc_map:update({&lt;&lt;&quot;smiles&quot;&gt;&gt;, counter},                                                                  fun(Counter) -&gt;                                                                      riakc_counter:increment(10, Counter)                                                                  end, UpdatedMap2),                                          UpdatedMap3                                      end,                             {&lt;&lt;&quot;documents-type&quot;&gt;&gt;, &lt;&lt;&quot;documents-bucket&quot;&gt;&gt;}, &lt;&lt;&quot;DocumentKey&quot;&gt;&gt;, []).  % \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c riakc_pb_socket:search(RiakPid, &lt;&lt;&quot;documents-index&quot;&gt;&gt;, &lt;&lt;&quot;body_register:\\&quot;\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435\\&quot;&quot;&gt;&gt;). <\/code><\/pre>\n<p>  \u0423\u0434\u0430\u043b\u044f\u0435\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442  <\/p>\n<pre><code class=\"erlang_repl\">riakc_pb_socket:delete(RiakPid, {&lt;&lt;&quot;documents-type&quot;&gt;&gt;, &lt;&lt;&quot;documents-bucket&quot;&gt;&gt;}, &lt;&lt;&quot;DocumentKey&quot;&gt;&gt;).  % \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c riakc_pb_socket:search(RiakPid, &lt;&lt;&quot;documents-index&quot;&gt;&gt;, &lt;&lt;&quot;body_register:\\&quot;\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435\\&quot;&quot;&gt;&gt;). <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0411\u043e\u043b\u044c\u0448\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439:<\/h4>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/basho\/riak-erlang-client\/blob\/master\/README.md\">Riak Protocol Buffers Client Introduction<\/a><\/li>\n<li><a href=\"http:\/\/docs.basho.com\/riak\/latest\/dev\/using\/data-types\/\">Riak Docs \u2014 Using Data Types<\/a><\/li>\n<li><a href=\"http:\/\/docs.basho.com\/riak\/latest\/dev\/using\/basics\/\">Riak Docs \u2014 The Basics<\/a><\/li>\n<\/ul>\n<p>  \u041f\u043e\u043a\u0430 \u043d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0451. \u0415\u0441\u043b\u0438 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439, \u0442\u043e \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u0437 \u043d\u0430\u043f\u0438\u0448\u0443 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043d\u0430 \u0431\u0430\u0437\u0435 cowboy.             <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/265399\/\"> http:\/\/habrahabr.ru\/post\/265399\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>             <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/459\/f23\/cff\/459f23cff564449389a03f1f2093226e.png\"\/><\/p>\n<p>  \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0432 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0446\u0435\u043b\u044f\u0445 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u0431\u0430\u0437\u0435 Riak \u0432\u0435\u0440\u0441\u0438\u0438 2.1.1 \u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e \u043d\u0438\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Riak Search (Yokozuna). \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <a href=\"https:\/\/github.com\/basho\/riak-erlang-client\/\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442 \u0434\u043b\u044f Erlang<\/a>.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u0430\u043a\u0438\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432:  <\/p>\n<ul>\n<li>title \u2014 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a;<\/li>\n<li>body \u2014 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435;<\/li>\n<li>tags \u2014 \u0442\u044d\u0433\u0438;<\/li>\n<li>created_at \u2014 \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f;<\/li>\n<li>smiles \u2014 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043c\u0430\u0439\u043b\u0438\u043a\u043e\u0432 (\u043f\u043b\u044e\u0441\u0438\u043a\u043e\u0432, \u043b\u0430\u0439\u043a\u043e\u0432, \u043a\u0430\u043a \u0445\u043e\u0442\u0438\u0442\u0435)<\/li>\n<\/ul>\n<p>  \u0438 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c. \u041a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043d\u0430\u0447\u043d\u0451\u043c.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-264242","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/264242","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=264242"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/264242\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=264242"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=264242"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=264242"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}