No commit activity in last 3 years
No release in over 3 years
Allows the override of some Sunspot Solr HTTP settings
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 1.0
~> 2.0
 Project Readme

SunspotConnector

Ever wanted to override the default HTTP client used in RSolr? I have, and now you can too. If you put Solr behind a reverse proxy that supports gzip you'll need additional headers and a better HTTP client than the default to allow that. This gem provides hooks to make those changes. It also sets a keep-alive header by default which can provide some nice performance improvements if you make a lot of small requests and switch to a faraday adapter that supports it.

Installation

gem 'sunspot_connector'

# Optionally add a new faraday adapter
gem 'em-synchrony', '~> 1.0'
gem 'em-http-request', '~> 1.0'

In your Rails config:

solr_override = SunspotConnector::Config.new
solr_override.headers = { 'Accept-Encoding' => 'gzip,deflate' } # send some extra headers with every request
solr_override.adapter = :em_synchrony # override the default http connector, any faraday adapter should do
config.solr_connection_overrides = solr_override

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/mlh758/sunspot_connector.

License

The gem is available as open source under the terms of the MIT License.