这是indexloc提供的服务,不要输入任何密码
Skip to content

mosuka/rsolr-cloud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RSolr::Cloud

The connection adopter supporting SolrCloud for RSolr.

Installation

Add this line to your application's Gemfile:

gem 'rsolr-cloud'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rsolr-cloud

Example

require 'zk'
require 'rsolr/cloud'

# Create Zookeeper client for the Zookeeper ensemble in SolrCloud.
zk = ZK.new('localhost:2181,localhost:2182,localhost:2183')

# Connecting the SolrCloud through the Zookeeper.
cloud_connection = RSolr::Cloud::Connection.new(zk)

# Get rsolr client for solr_cloud.
solr_client  = RSolr::Client.new(cloud_connection,
                                 read_timeout: 60,
                                 open_timeout: 60)

# You can use rsolr as usual but collection: option must be specified with the name of the collection.
response = solr.get('select', collection: 'collection1', params: {q: '*:*'})

Contributing

  1. Fork it ( https://github.com/[my-github-username]/rsolr-cloud/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

About

The connection adopter supporting SolrCloud for RSolr.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%