Solr::Client

fast solr client for ruby

Installation

Add this line to your application's Gemfile:

gem 'solr-client'

And then execute:

$ bundle

Or install it yourself as:

$ gem install solr-client

Usage

solr_base_url = "http://localhost:8983/solr"
client = Solr::Client.new(solr_base_url)
client.core = "article"
rows = mysql.query("select * from article order by id asc limit 100")
rows.each do |row|
  solr_client.add(row)
end
solr_client.commit
solr_client.stop

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request