riak-client 2.4.1 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.document +5 -5
- data/.gitignore +3 -0
- data/Gemfile +17 -17
- data/Guardfile +20 -20
- data/LICENSE.md +16 -16
- data/RELNOTES.md +4 -0
- data/Rakefile +6 -1
- data/lib/riak/client/beefcake/crdt/counter_loader.rb +18 -18
- data/lib/riak/client/beefcake/crdt/hyper_log_log_loader.rb +18 -0
- data/lib/riak/client/beefcake/crdt/map_loader.rb +64 -64
- data/lib/riak/client/beefcake/crdt_loader.rb +4 -1
- data/lib/riak/client/beefcake/crdt_operator.rb +13 -0
- data/lib/riak/client/beefcake/footer +4 -4
- data/lib/riak/client/beefcake/header +6 -6
- data/lib/riak/client/beefcake/messages.rb +67 -10
- data/lib/riak/client/decaying.rb +36 -36
- data/lib/riak/client/feature_detection.rb +120 -120
- data/lib/riak/client/instrumentation.rb +19 -19
- data/lib/riak/client/node.rb +49 -49
- data/lib/riak/client/search.rb +27 -27
- data/lib/riak/conflict.rb +13 -13
- data/lib/riak/core_ext.rb +7 -7
- data/lib/riak/core_ext/blank.rb +53 -53
- data/lib/riak/core_ext/extract_options.rb +7 -7
- data/lib/riak/core_ext/json.rb +15 -15
- data/lib/riak/core_ext/slice.rb +18 -18
- data/lib/riak/core_ext/stringify_keys.rb +10 -10
- data/lib/riak/core_ext/symbolize_keys.rb +10 -10
- data/lib/riak/core_ext/to_param.rb +31 -31
- data/lib/riak/crdt.rb +23 -21
- data/lib/riak/crdt/base.rb +1 -1
- data/lib/riak/crdt/hyper_log_log.rb +97 -0
- data/lib/riak/crdt/operation.rb +19 -19
- data/lib/riak/encoding.rb +6 -6
- data/lib/riak/errors/backend_creation.rb +9 -9
- data/lib/riak/errors/connection_error.rb +50 -50
- data/lib/riak/errors/protobuffs_error.rb +11 -11
- data/lib/riak/i18n.rb +7 -7
- data/lib/riak/instrumentation.rb +6 -6
- data/lib/riak/json.rb +52 -52
- data/lib/riak/list_buckets.rb +28 -28
- data/lib/riak/locale/en.yml +1 -0
- data/lib/riak/locale/fr.yml +51 -51
- data/lib/riak/map_reduce/results.rb +49 -49
- data/lib/riak/map_reduce_error.rb +7 -7
- data/lib/riak/multiget.rb +122 -122
- data/lib/riak/robject.rb +17 -1
- data/lib/riak/search/result_document.rb +9 -0
- data/lib/riak/stamp.rb +77 -77
- data/lib/riak/tombstone.rb +13 -0
- data/lib/riak/util/tcp_socket_extensions.rb +58 -58
- data/lib/riak/version.rb +1 -1
- data/spec/failover/failover.rb +59 -59
- data/spec/fixtures/bitcask.txt +25 -25
- data/spec/fixtures/multipart-basic-conflict.txt +15 -15
- data/spec/fixtures/multipart-blank.txt +7 -7
- data/spec/fixtures/multipart-mapreduce.txt +10 -10
- data/spec/fixtures/multipart-with-body.txt +16 -16
- data/spec/fixtures/multipart-with-marked-tombstones.txt +17 -17
- data/spec/fixtures/multipart-with-unmarked-tombstone.txt +16 -16
- data/spec/fixtures/server.cert.crt +15 -15
- data/spec/fixtures/server.cert.key +15 -15
- data/spec/fixtures/test.pem +1 -1
- data/spec/integration/riak/bucket_types_spec.rb +38 -0
- data/spec/integration/riak/crdt/configuration_spec.rb +4 -3
- data/spec/integration/riak/crdt_spec.rb +70 -0
- data/spec/integration/riak/encodings/crdt_spec.rb +29 -3
- data/spec/integration/riak/encodings/yz_spec.rb +2 -1
- data/spec/integration/riak/preflist_spec.rb +15 -3
- data/spec/integration/riak/protobuffs/timeouts_spec.rb +1 -1
- data/spec/integration/riak/security_spec.rb +11 -6
- data/spec/integration/riak/threading_spec.rb +154 -150
- data/spec/integration/yokozuna/index_spec.rb +61 -61
- data/spec/integration/yokozuna/queries_spec.rb +1 -1
- data/spec/integration/yokozuna/schema_spec.rb +49 -49
- data/spec/riak/beefcake_protobuffs_backend/crdt_operator_spec.rb +22 -0
- data/spec/riak/core_ext/to_param_spec.rb +15 -15
- data/spec/riak/crdt/hyper_log_log_spec.rb +56 -0
- data/spec/riak/crdt/inner_counter_spec.rb +21 -21
- data/spec/riak/crdt/inner_set_spec.rb +33 -33
- data/spec/riak/crdt/set_spec.rb +61 -61
- data/spec/riak/crdt/shared_examples.rb +14 -0
- data/spec/riak/escape_spec.rb +72 -72
- data/spec/riak/feature_detection_spec.rb +77 -77
- data/spec/riak/index_collection_spec.rb +53 -53
- data/spec/riak/instrumentation_spec.rb +124 -124
- data/spec/riak/link_spec.rb +85 -85
- data/spec/riak/list_buckets_spec.rb +41 -41
- data/spec/riak/node_spec.rb +26 -26
- data/spec/riak/robject_spec.rb +45 -0
- data/spec/support/certs/README.md +12 -12
- data/spec/support/certs/ca.crt +21 -21
- data/spec/support/certs/client.crl +13 -13
- data/spec/support/certs/client.crt +94 -94
- data/spec/support/certs/client.csr +18 -18
- data/spec/support/certs/client.key +27 -27
- data/spec/support/certs/empty_ca.crt +21 -21
- data/spec/support/certs/server.crl +13 -13
- data/spec/support/certs/server.crt +94 -94
- data/spec/support/certs/server.key +27 -27
- data/spec/support/crdt_search_fixtures.rb +1 -1
- data/spec/support/integration_setup.rb +10 -10
- data/spec/support/test_client.rb +1 -1
- data/spec/support/test_client.yml.example +10 -10
- metadata +10 -3
@@ -1,6 +1,7 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
require 'spec_helper'
|
3
3
|
require 'riak'
|
4
|
+
require 'riak/util/string'
|
4
5
|
|
5
6
|
describe 'Encoding and Riak Search', integration: true, search_config: true do
|
6
7
|
let(:bucket_type){ test_client.bucket_type 'yokozuna' }
|
@@ -72,7 +73,7 @@ EOD
|
|
72
73
|
expect(results).to_not be_empty
|
73
74
|
expect(results.docs.first.bucket_type).to eq robj.bucket.type
|
74
75
|
expect(results.docs.first.bucket).to eq robj.bucket
|
75
|
-
expect(results.docs.first.key.
|
76
|
+
expect(Riak::Util::String.equal_bytes?(results.docs.first.key, robj.key)).to be
|
76
77
|
end
|
77
78
|
end
|
78
79
|
|
@@ -18,14 +18,26 @@ describe 'Preflist', integration: true, test_client: true do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'is available from RObjects' do
|
21
|
-
|
21
|
+
begin
|
22
|
+
expect(robject.preflist).to be_a_preflist
|
23
|
+
rescue Riak::ProtobuffsErrorResponse
|
24
|
+
skip('preflists are not supported')
|
25
|
+
end
|
22
26
|
end
|
23
27
|
|
24
28
|
it 'is available from Buckets' do
|
25
|
-
|
29
|
+
begin
|
30
|
+
expect(bucket.get_preflist robject.key).to be_a_preflist
|
31
|
+
rescue Riak::ProtobuffsErrorResponse
|
32
|
+
skip('preflists are not supported')
|
33
|
+
end
|
26
34
|
end
|
27
35
|
|
28
36
|
it 'is available from the Client' do
|
29
|
-
|
37
|
+
begin
|
38
|
+
expect(test_client.get_preflist bucket.name, robject.key).to be_a_preflist
|
39
|
+
rescue Riak::ProtobuffsErrorResponse
|
40
|
+
skip('preflists are not supported')
|
41
|
+
end
|
30
42
|
end
|
31
43
|
end
|
@@ -4,7 +4,7 @@ require 'spec_helper'
|
|
4
4
|
require 'riak/client/beefcake/messages'
|
5
5
|
require 'riak/client/beefcake/protocol'
|
6
6
|
|
7
|
-
describe 'Protocol Buffers', test_client: true, integration: true do
|
7
|
+
describe 'Protocol Buffers', test_client: true, integration: true, slow: true do
|
8
8
|
if RUBY_VERSION >= '2.0.0'
|
9
9
|
describe 'timeouts' do
|
10
10
|
it 'raises error on connect timeout' do
|
@@ -51,9 +51,14 @@ describe 'Secure Protobuffs', test_client: true, integration: true do
|
|
51
51
|
|
52
52
|
bugged_crypto_client = Riak::Client.new broken_auth_config
|
53
53
|
|
54
|
-
|
55
|
-
|
56
|
-
|
54
|
+
if RUBY_PLATFORM == 'java'
|
55
|
+
expect{ bugged_crypto_client.ping }.
|
56
|
+
to(raise_error(OpenSSL::SSL::SSLError))
|
57
|
+
else
|
58
|
+
expect{ bugged_crypto_client.ping }.
|
59
|
+
to(raise_error(OpenSSL::SSL::SSLError,
|
60
|
+
/certificate verify failed/i))
|
61
|
+
end
|
57
62
|
end
|
58
63
|
|
59
64
|
it "refuses to connect if the server cert is revoked" do
|
@@ -86,10 +91,10 @@ describe 'Secure Protobuffs', test_client: true, integration: true do
|
|
86
91
|
|
87
92
|
client_cert_config[:authentication][:client_ca] = client_cert_config[:authentication]['ca_file']
|
88
93
|
|
89
|
-
client_cert_config[:authentication][:cert] = '
|
90
|
-
client_cert_config[:authentication][:key] = '
|
94
|
+
client_cert_config[:authentication][:cert] = 'tools/test-ca/certs/riakuser-client-cert.pem'
|
95
|
+
client_cert_config[:authentication][:key] = 'tools/test-ca/private/riakuser-client-cert-key.pem'
|
91
96
|
|
92
|
-
client_cert_config[:authentication][:user] = '
|
97
|
+
client_cert_config[:authentication][:user] = 'riakuser'
|
93
98
|
client_cert_config[:authentication][:password] = ''
|
94
99
|
|
95
100
|
cert_client = Riak::Client.new client_cert_config
|
@@ -1,150 +1,154 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "Multithreaded client", :test_client => true do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
end
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
end
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
count
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
end
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "Multithreaded client", :test_client => true do
|
4
|
+
if ENV['TRAVIS'] == 'true' && RUBY_PLATFORM == 'java'
|
5
|
+
skip 'multithreaded client tests time out on Travis CI'
|
6
|
+
break
|
7
|
+
end
|
8
|
+
class Synchronizer
|
9
|
+
def initialize(n)
|
10
|
+
@mutex = Mutex.new
|
11
|
+
@n = n
|
12
|
+
@waiting = Set.new
|
13
|
+
end
|
14
|
+
|
15
|
+
def sync
|
16
|
+
stop = false
|
17
|
+
@mutex.synchronize do
|
18
|
+
@waiting << Thread.current
|
19
|
+
|
20
|
+
if @waiting.size >= @n
|
21
|
+
# All threads are waiting.
|
22
|
+
@waiting.each do |t|
|
23
|
+
t.run
|
24
|
+
end
|
25
|
+
else
|
26
|
+
stop = true
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
if stop
|
31
|
+
Thread.stop
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def threads(n, opts = {})
|
37
|
+
if opts[:synchronize]
|
38
|
+
s1 = Synchronizer.new n
|
39
|
+
s2 = Synchronizer.new n
|
40
|
+
end
|
41
|
+
|
42
|
+
threads = (0...n).map do |i|
|
43
|
+
Thread.new do
|
44
|
+
if opts[:synchronize]
|
45
|
+
s1.sync
|
46
|
+
end
|
47
|
+
|
48
|
+
yield i
|
49
|
+
|
50
|
+
if opts[:synchronize]
|
51
|
+
s2.sync
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
threads.each do |t|
|
57
|
+
t.join
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
[
|
62
|
+
{:protobuffs_backend => :Beefcake}
|
63
|
+
].each do |opts|
|
64
|
+
describe opts.inspect do
|
65
|
+
before do
|
66
|
+
@bucket = random_bucket 'threading'
|
67
|
+
end
|
68
|
+
|
69
|
+
it 'gets in parallel' do
|
70
|
+
data = "the gun is good"
|
71
|
+
ro = @bucket.new('test')
|
72
|
+
ro.content_type = "application/json"
|
73
|
+
ro.data = [data]
|
74
|
+
ro.store
|
75
|
+
|
76
|
+
threads 10, :synchronize => true do
|
77
|
+
x = @bucket['test']
|
78
|
+
expect(x.content_type).to eq("application/json")
|
79
|
+
expect(x.data).to eq([data])
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
it 'puts in parallel' do
|
84
|
+
data = "the tabernacle is indestructible and everlasting"
|
85
|
+
|
86
|
+
n = 10
|
87
|
+
threads n, :synchronize => true do |i|
|
88
|
+
x = @bucket.new("test-#{i}")
|
89
|
+
x.content_type = "application/json"
|
90
|
+
x.data = ["#{data}-#{i}"]
|
91
|
+
x.store
|
92
|
+
end
|
93
|
+
|
94
|
+
(0...n).each do |i|
|
95
|
+
read = @bucket["test-#{i}"]
|
96
|
+
expect(read.content_type).to eq("application/json")
|
97
|
+
expect(read.data).to eq(["#{data}-#{i}"])
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
# This is a 1.0+ spec because putting with the same client ID
|
102
|
+
# will not create siblings on 0.14 in the same way. This will
|
103
|
+
# also likely fail for nodes with vnode_vclocks = false.
|
104
|
+
it 'puts conflicts in parallel' do
|
105
|
+
@bucket.allow_mult = true
|
106
|
+
expect(@bucket.allow_mult).to eq(true)
|
107
|
+
|
108
|
+
init = @bucket.new('test')
|
109
|
+
init.content_type = "application/json"
|
110
|
+
init.data = ''
|
111
|
+
init.store
|
112
|
+
|
113
|
+
# Create conflicting writes
|
114
|
+
n = 10
|
115
|
+
s = Synchronizer.new n
|
116
|
+
threads n, :synchronize => true do |i|
|
117
|
+
x = @bucket["test"]
|
118
|
+
s.sync
|
119
|
+
x.data = [i]
|
120
|
+
x.store
|
121
|
+
end
|
122
|
+
|
123
|
+
read = @bucket["test"]
|
124
|
+
expect(read.conflict?).to eq(true)
|
125
|
+
expect(read.siblings.map do |sibling|
|
126
|
+
sibling.data.first
|
127
|
+
end.to_set).to eq((0...n).to_set)
|
128
|
+
end
|
129
|
+
|
130
|
+
it 'lists-keys and gets in parallel', :slow => true do
|
131
|
+
count = 100
|
132
|
+
threads = 2
|
133
|
+
|
134
|
+
# Create items
|
135
|
+
count.times do |i|
|
136
|
+
o = @bucket.new("#{i}")
|
137
|
+
o.content_type = 'application/json'
|
138
|
+
o.data = [i]
|
139
|
+
o.store
|
140
|
+
end
|
141
|
+
|
142
|
+
threads(threads) do
|
143
|
+
set = Set.new
|
144
|
+
@bucket.keys do |stream|
|
145
|
+
stream.each do |key|
|
146
|
+
set.merge @bucket[key].data
|
147
|
+
end
|
148
|
+
end
|
149
|
+
expect(set).to eq((0...count).to_set)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
@@ -1,61 +1,61 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'riak'
|
3
|
-
|
4
|
-
describe "Yokozuna", test_client: true, integration: true do
|
5
|
-
before(:all) do
|
6
|
-
@client = test_client
|
7
|
-
|
8
|
-
@index = 'yz_spec-' + random_key
|
9
|
-
@schema = 'yz_spec-' + random_key
|
10
|
-
end
|
11
|
-
|
12
|
-
context "without any indexes" do
|
13
|
-
it "allows index creation" do
|
14
|
-
expect(@client.create_search_index(@index, "_yz_default", 3)).to eq(true)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
context "with an index" do
|
19
|
-
before :all do
|
20
|
-
expect(@client.create_search_index(@index)).to eq(true)
|
21
|
-
wait_until{ !@client.get_search_index(@index).nil? }
|
22
|
-
end
|
23
|
-
|
24
|
-
it "allows index inspection" do
|
25
|
-
expect(@client.get_search_index(@index).name).to eq(@index)
|
26
|
-
expect{ @client.get_search_index("herp_derp") }.to raise_error(Riak::ProtobuffsFailedRequest)
|
27
|
-
end
|
28
|
-
|
29
|
-
it "has an index list" do
|
30
|
-
expect(@client.list_search_indexes.size).to be >= 1
|
31
|
-
end
|
32
|
-
|
33
|
-
it "associates a bucket with an index" do
|
34
|
-
@bucket = Riak::Bucket.new(@client, @index)
|
35
|
-
@bucket.props = {'search_index' => @index}
|
36
|
-
@bucket = @client.bucket(@index)
|
37
|
-
expect(@bucket.props).to include('search_index' => @index)
|
38
|
-
end
|
39
|
-
|
40
|
-
context "associated with a bucket" do
|
41
|
-
before :all do
|
42
|
-
@bucket = Riak::Bucket.new(@client, @index)
|
43
|
-
@bucket.props = {'search_index' => @index}
|
44
|
-
@bucket = @client.bucket(@index)
|
45
|
-
expect(@bucket.props).to include('search_index' => @index)
|
46
|
-
end
|
47
|
-
|
48
|
-
it "indexes on object writes" do
|
49
|
-
object = @bucket.get_or_new("cat")
|
50
|
-
object.raw_data = {"cat_s"=>"Lela"}.to_json
|
51
|
-
object.content_type = 'application/json'
|
52
|
-
object.store
|
53
|
-
sleep
|
54
|
-
|
55
|
-
resp = @client.search(@index, "cat_s:Lela")
|
56
|
-
expect(resp).to include('docs')
|
57
|
-
expect(resp['docs'].size).to eq(1)
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'riak'
|
3
|
+
|
4
|
+
describe "Yokozuna", test_client: true, integration: true do
|
5
|
+
before(:all) do
|
6
|
+
@client = test_client
|
7
|
+
|
8
|
+
@index = 'yz_spec-' + random_key
|
9
|
+
@schema = 'yz_spec-' + random_key
|
10
|
+
end
|
11
|
+
|
12
|
+
context "without any indexes" do
|
13
|
+
it "allows index creation" do
|
14
|
+
expect(@client.create_search_index(@index, "_yz_default", 3)).to eq(true)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
context "with an index" do
|
19
|
+
before :all do
|
20
|
+
expect(@client.create_search_index(@index)).to eq(true)
|
21
|
+
wait_until{ !@client.get_search_index(@index).nil? }
|
22
|
+
end
|
23
|
+
|
24
|
+
it "allows index inspection" do
|
25
|
+
expect(@client.get_search_index(@index).name).to eq(@index)
|
26
|
+
expect{ @client.get_search_index("herp_derp") }.to raise_error(Riak::ProtobuffsFailedRequest)
|
27
|
+
end
|
28
|
+
|
29
|
+
it "has an index list" do
|
30
|
+
expect(@client.list_search_indexes.size).to be >= 1
|
31
|
+
end
|
32
|
+
|
33
|
+
it "associates a bucket with an index" do
|
34
|
+
@bucket = Riak::Bucket.new(@client, @index)
|
35
|
+
@bucket.props = {'search_index' => @index}
|
36
|
+
@bucket = @client.bucket(@index)
|
37
|
+
expect(@bucket.props).to include('search_index' => @index)
|
38
|
+
end
|
39
|
+
|
40
|
+
context "associated with a bucket" do
|
41
|
+
before :all do
|
42
|
+
@bucket = Riak::Bucket.new(@client, @index)
|
43
|
+
@bucket.props = {'search_index' => @index}
|
44
|
+
@bucket = @client.bucket(@index)
|
45
|
+
expect(@bucket.props).to include('search_index' => @index)
|
46
|
+
end
|
47
|
+
|
48
|
+
it "indexes on object writes" do
|
49
|
+
object = @bucket.get_or_new("cat")
|
50
|
+
object.raw_data = {"cat_s"=>"Lela"}.to_json
|
51
|
+
object.content_type = 'application/json'
|
52
|
+
object.store
|
53
|
+
sleep 2.1 # pause for index commit to trigger
|
54
|
+
|
55
|
+
resp = @client.search(@index, "cat_s:Lela")
|
56
|
+
expect(resp).to include('docs')
|
57
|
+
expect(resp['docs'].size).to eq(1)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|