spec/support/search_config.rb in riak-client-2.2.0.pre1 vs spec/support/search_config.rb in riak-client-2.2.0

- old
+ new

@@ -9,27 +9,29 @@ def index_name @index_name ||= search_bucket.name end + def index + return @index if defined? @index + create_index + @index = Riak::Search::Index.new test_client, index_name + end + def create_index return if defined? @index_exists test_client.create_search_index index_name - wait_until do - test_client.get_search_index index_name - end - @index_exists = true end def configure_bucket return if defined? @bucket_configured create_index - test_client.set_bucket_props(search_bucket, + test_client.set_bucket_props(search_bucket, { search_index: index_name }, 'yokozuna') wait_until do props = test_client.get_bucket_props search_bucket, type: 'yokozuna'