riak-client 2.0.0.rc2 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.markdown +28 -46
- data/lib/riak/version.rb +1 -1
- data/riak-client.gemspec +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad40ac9eb63589a4a5ec590cec005f72da1d5865
|
4
|
+
data.tar.gz: 728c720266417b1f07e0d2078b83deb49341e004
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d74e7d77692280c40f0777b0c80dad5455592584e116f1ea12a9eeca2d53e14bd38b32cca201fafd15550767d305a13ae2127376c3fef4339204ed1d860f554f
|
7
|
+
data.tar.gz: 8073b45333abf60fb4965afea5eaca555b44761abe08089295f742d1bcd937c0ee8027319f0c65f3d86e0caf57cc63ae5b538430fc161d500939c885650045b2
|
data/README.markdown
CHANGED
@@ -96,7 +96,7 @@ new_one.store
|
|
96
96
|
|
97
97
|
## Bucket Types
|
98
98
|
|
99
|
-
Riak 2 uses [bucket types](http://docs.basho.com/riak/
|
99
|
+
Riak 2 uses [bucket types](http://docs.basho.com/riak/latest/dev/advanced/bucket-types/) to
|
100
100
|
enable groups of similar buckets to share properties, configuration, and to namespace values
|
101
101
|
within those buckets. Bucket type support is integral to how CRDTs work.
|
102
102
|
|
@@ -141,51 +141,33 @@ p results # => ["Please Please Me", "With The Beatles", "A Hard Day's Night",
|
|
141
141
|
|
142
142
|
## Riak Search Examples
|
143
143
|
|
144
|
-
For more information about Riak Search, see [the
|
144
|
+
This client supports the new Riak Search 2 (codenamed "Yokozuna"). For more information about Riak Search, see [the Riak documentation](http://docs.basho.com/riak/latest/dev/using/search/).
|
145
145
|
|
146
|
-
|
147
|
-
# Create a client, specifying the Solr-compatible endpoint
|
148
|
-
# When connecting to Riak 0.14 and later, the Solr endpoint configuration option is not necessary.
|
149
|
-
client = Riak::Client.new :solr => "/solr"
|
150
|
-
|
151
|
-
# Search the default index for documents
|
152
|
-
result = client.search("title:Yesterday") # Returns a vivified JSON object
|
153
|
-
# containing 'responseHeaders' and 'response' keys
|
154
|
-
result['response']['numFound'] # total number of results
|
155
|
-
result['response']['start'] # offset into the total result set
|
156
|
-
result['response']['docs'] # the list of indexed documents
|
157
|
-
|
158
|
-
# Search the 'users' index for documents
|
159
|
-
client.search("users", "name:Sean")
|
160
|
-
|
161
|
-
# Add a document to an index
|
162
|
-
client.index("users", {:id => "sean@basho.com", :name => "Sean Cribbs"}) # adds to the 'users' index
|
163
|
-
|
164
|
-
client.index({:id => "index.html", :content => "Hello, world!"}) # adds to the default index
|
165
|
-
|
166
|
-
client.index({:id => 1, :name => "one"}, {:id => 2, :name => "two"}) # adds multiple docs
|
167
|
-
|
168
|
-
# Remove document(s) from an index
|
169
|
-
client.remove({:id => 1}) # removes the document with ID 1
|
170
|
-
client.remove({:query => "archived"}) # removes all documents matching query
|
171
|
-
client.remove({:id => 1}, {:id => 5}) # removes multiple docs
|
146
|
+
This documentation assumes there's a `yokozuna` bucket type created and activated.
|
172
147
|
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
148
|
+
``` ruby
|
149
|
+
# Create a client and bucket.
|
150
|
+
client = Riak::Client.new
|
151
|
+
bucket = client.bucket 'pizzas'
|
152
|
+
|
153
|
+
# Create an index and add it to a typed bucket. Setting the index on the bucket
|
154
|
+
# may fail until the index creation has propagated.
|
155
|
+
client.create_search_index 'pizzas'
|
156
|
+
client.set_bucket_props bucket, {search_index: 'pizzas'}, 'yokozuna'
|
157
|
+
|
158
|
+
# Store some records for indexing
|
159
|
+
meat = bucket.new 'meat'
|
160
|
+
meat.data = {toppings_ss: %w{pepperoni ham sausage}}
|
161
|
+
meat.store type: 'yokozuna'
|
162
|
+
|
163
|
+
hawaiian = bucket.new 'hawaiian'
|
164
|
+
hawaiian.data = {toppings_ss: %w{ham pineapple}}
|
165
|
+
hawaiian.store type: 'yokozuna'
|
166
|
+
|
167
|
+
# Search the pizzas index for hashes that have a "ham" entry in the toppings_ss array
|
168
|
+
result = client.search('pizzas', 'toppings_ss:ham') # Returns a results hash
|
169
|
+
result['num_found'] # total number of results
|
170
|
+
result['docs'] # the list of indexed documents
|
189
171
|
```
|
190
172
|
|
191
173
|
## Secondary Index Examples
|
@@ -406,7 +388,7 @@ in the `lib/riak/crdt` directory.
|
|
406
388
|
|
407
389
|
## Riak 1.4 Counters
|
408
390
|
|
409
|
-
For more information about counters in Riak, see [the Basho
|
391
|
+
For more information about 1.4-style counters in Riak, see [the Basho documentation](http://docs.basho.com/riak/latest/dev/references/http/counters/).
|
410
392
|
|
411
393
|
Counter records are automatically persisted on increment or decrement. The initial default value is 0.
|
412
394
|
|
@@ -488,7 +470,7 @@ That's about it. PN Counters in Riak are distributed, so each node will receive
|
|
488
470
|
|
489
471
|
## License & Copyright
|
490
472
|
|
491
|
-
Copyright ©2010-
|
473
|
+
Copyright ©2010-2014 Sean Cribbs and Basho Technologies, Inc.
|
492
474
|
|
493
475
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
|
494
476
|
|
data/lib/riak/version.rb
CHANGED
data/riak-client.gemspec
CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |gem|
|
|
22
22
|
gem.add_development_dependency 'simplecov', '~> 0.8.2'
|
23
23
|
|
24
24
|
gem.add_runtime_dependency "i18n", ">=0.4.0"
|
25
|
-
gem.add_runtime_dependency "beefcake", "
|
25
|
+
gem.add_runtime_dependency "beefcake", "~> 1.0"
|
26
26
|
gem.add_runtime_dependency "multi_json", "~>1.0"
|
27
27
|
gem.add_runtime_dependency "innertube", "~>1.0.2"
|
28
28
|
gem.add_runtime_dependency 'cert_validator', '~> 0.0.1'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: riak-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Cribbs
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-09-
|
12
|
+
date: 2014-09-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -99,16 +99,16 @@ dependencies:
|
|
99
99
|
name: beefcake
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
|
-
- - "
|
102
|
+
- - "~>"
|
103
103
|
- !ruby/object:Gem::Version
|
104
|
-
version: 1.0
|
104
|
+
version: '1.0'
|
105
105
|
type: :runtime
|
106
106
|
prerelease: false
|
107
107
|
version_requirements: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
|
-
- - "
|
109
|
+
- - "~>"
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
version: 1.0
|
111
|
+
version: '1.0'
|
112
112
|
- !ruby/object:Gem::Dependency
|
113
113
|
name: multi_json
|
114
114
|
requirement: !ruby/object:Gem::Requirement
|
@@ -336,12 +336,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
336
336
|
version: 1.9.3
|
337
337
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
338
338
|
requirements:
|
339
|
-
- - "
|
339
|
+
- - ">="
|
340
340
|
- !ruby/object:Gem::Version
|
341
|
-
version:
|
341
|
+
version: '0'
|
342
342
|
requirements: []
|
343
343
|
rubyforge_project:
|
344
|
-
rubygems_version: 2.
|
344
|
+
rubygems_version: 2.3.0
|
345
345
|
signing_key:
|
346
346
|
specification_version: 4
|
347
347
|
summary: riak-client is a rich client for Riak, the distributed database by Basho.
|