Comments (3)
There is a larger issue here that affects is_indexed?, enable_index! and disable_index!.
Looks like these blocks of code require props['precommit'] to be set or in the very least to be initialised to []:
188 # (Riak Search) Installs a precommit hook that automatically indexes objects
189 # into riak_search.
190 def enable_index!
191 unless is_indexed?
192 self.props = {"precommit" => (props['precommit'] + [SEARCH_PRECOMMIT_HOOK]), "search" => true}
193 end
194 end
195
196 # (Riak Search) Removes the precommit hook that automatically indexes objects
197 # into riak_search.
198 def disable_index!
199 if is_indexed?
200 self.props = {"precommit" => (props['precommit'] - [SEARCH_PRECOMMIT_HOOK]), "search" => false}
201 end
202 end
203
204 # (Riak Search) Detects whether the bucket is automatically indexed into
205 # riak_search.
206 # @return [true,false] whether the bucket includes the search indexing hook
207 def is_indexed?
208 props['search'] == true || props['precommit'].include?(SEARCH_PRECOMMIT_HOOK)
209 end
But in my installation of riak (v1.3.1~precise1) and riak-client (v1.1.1) the bucket props are:
irb(main):005:0* bucket.props
=> {"n_val"=>3, "allow_mult"=>false}
from riak-ruby-client.
I've narrowed this down further. The issue seems specific to Excon and Protobufs backends as the default HTTP backend works perfectly fine:
irb(main):047:0* require "riak"; client = Riak::Client.new; bucket_name = "tweets"; bucket = client.bucket bucket_name
=> #<Riak::Bucket {tweets}>
irb(main):048:0>
irb(main):049:0* bucket.props
=> {"allow_mult"=>false, "basic_quorum"=>false, "big_vclock"=>50, "chash_keyfun"=>{"mod"=>"riak_core_util", "fun"=>"chash_std_keyfun"}, "dw"=>"quorum", "last_write_wins"=>false, "linkfun"=>{"mod"=>"riak_kv_wm_link_walker", "fun"=>"mapreduce_linkfun"}, "n_val"=>3, "name"=>"tweets", "notfound_ok"=>true, "old_vclock"=>86400, "postcommit"=>[], "pr"=>0, "precommit"=>[{"mod"=>"riak_search_kv_hook", "fun"=>"precommit"}], "pw"=>0, "r"=>"quorum", "rw"=>"quorum", "search"=>true, "small_vclock"=>50, "w"=>"quorum", "young_vclock"=>20}
irb(main):050:0>
irb(main):051:0* bucket.is_indexed?
=> true
from riak-ruby-client.
This is a known limitation of PB that it did not expose all bucket props; the fix is coming in Riak 1.4. For the Excon thing, see #83
from riak-ruby-client.
Related Issues (20)
- Riak search instructions do not work [JIRA: CLIENTS-404] HOT 1
- Cannot connect to Riak via SSL HOT 9
- Don't error on empty TsQueryResp responses [JIRA: CLIENTS-620] HOT 1
- Timestamp value parsing [JIRA: CLIENTS-822] HOT 3
- Finding objects by integer keys fail badly [JIRA: CLIENTS-865] HOT 2
- Improve error when non-String is used as a key [JIRA: CLIENTS-868]
- TimeSeries Query returning timestamps with rounding error [JIRA: CLIENTS-889] HOT 11
- Some tests fail running under OSX [JIRA: CLIENTS-890] HOT 1
- `getaddrinfo': can't convert Hash into String (TypeError) [JIRA: CLIENTS-924] HOT 8
- Update support for 1.9.3 [JIRA: CLIENTS-947] HOT 1
- Errors when using beefcake 1.2.0 [JIRA: CLIENTS-949] HOT 1
- Need clean way to handle deleted objects and tombstones [JIRA: CLIENTS-965] HOT 5
- Implement saving bucket type properties [JIRA: CLIENTS-1010]
- Ruby tests fails with latests TS version [JIRA: CLIENTS-1052] HOT 2
- wait_for_finish should not be public [JIRA: CLIENTS-1054] HOT 4
- GSet Support - Ruby [JIRA: CLIENTS-1062]
- Add warning and safety mechanism to prevent unintentional list [buckets | keys] operations [JIRA: CLIENTS-1071] HOT 1
- Ruby content.meta does not correctly apply X-Riak-Meta- prefix [JIRA: CLIENTS-1109] HOT 3
- Use RIAK Client in Multithreaded application
- Interview partners for research about communication in GitHub projects wanted
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from riak-ruby-client.