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
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request