Created
September 3, 2014 11:55
-
-
Save coderoshi/a12e30e4c4c152ec6e41 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: UTF-8 | |
require 'riak' | |
require 'rsolr' | |
require 'ap' | |
client = Riak::Client.new(nodes: [{pb_port:10017}]) | |
people = client.bucket('people') | |
map = Riak::Crdt::Map.new(people, 'eric', 'maps') | |
map.registers['first'] = 'MY_NAME' | |
map.registers['phone'] = '5551234567' | |
ap map.registers['first_name'] | |
# solr = RSolr.connect(url: 'http://localhost:10018/solr/people') | |
# resp = solr.get('select', params:{q:'first_register:MY_NAME', fl:'first_register,phone_register'}) | |
# ap resp["response"]["docs"].first |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
curl -XPUT http://localhost:10018/search/index/people
riak-admin bucket-type create maps '{"props":{"datatype":"map"}}'
curl -XPUT http://localhost:10018/types/maps/buckets/people/props -H'Content-Type:application/json' -d'{"props":{"search_index":"people"}}'