Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

docs

  • Loading branch information...
commit c3ea54f691caec7dd441f50d1e48bc84ae0d0e17 1 parent 6a81222
@justinko authored
Showing with 71 additions and 0 deletions.
  1. +20 −0 LICENSE
  2. +51 −0 README.md
View
20 LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2011 Justin Ko
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
51 README.md
@@ -0,0 +1,51 @@
+# sunspot-rails-failover
+
+Sunspot comes with `MasterSlaveSessionProxy` that does the following:
+
+> This session proxy implementation allows Sunspot to be used with a
+> master/slave Solr deployment. All write methods are delegated to a master
+> session, and read methods are delegated to a slave session.
+
+What this simple gem does is provide failover support if the slave session
+goes down. Reads *and* writes are called on the master session.
+
+## Setup
+
+Your config/sunspot.yml file should look something like this:
+
+ development:
+ master_solr:
+ url: http://localhost:8984/solr
+ solr:
+ url: http://localhost:8985/solr
+
+NOTE: You do *not* have to have a master session. If a master session is
+not detected, sunspot-rails-failover will default to what sunspot_rails
+provides.
+
+Next, add an initializer (maybe initializers/sunspot.rb) with the following
+code:
+
+ Sunspot::Rails::Failover.setup
+
+## Exception handling
+
+sunspot-rails-failover supports exception handling for committing and
+searching. Currently, it will use Hoptoad by default if it is installed.
+The exception is passed to `HoptoadNotifier.notify`.
+
+You can also use a custom class/module to customize how you want to handle the
+exception. In `initializers/sunspot.rb`:
+
+ module MyExceptionHandler
+ def self.handle(exception)
+ Notifier.deliver_exception_message(exception)
+ end
+ end
+
+ Sunspot::Rails::Failover.exception_handler = MyExceptionHandler
+ Sunspot::Rails::Failover.setup
+
+## Copyright
+
+Copyright (c) 2011 Justin Ko. See LICENSE for details.
Please sign in to comment.
Something went wrong with that request. Please try again.