Sha256: 46aa05183610edab00e0eb1423763ad153c3897ab359850b2928fcfe067d3172
Contents?: true
Size: 1.84 KB
Versions: 2
Compression:
Stored size: 1.84 KB
Contents
h1. Delayed Deltas for Thinking Sphinx h2. Installation You'll need Thinking Sphinx 1.3.0 or later, and Delayed Job as well. The latter is flagged as a dependency. <pre><code>gem install ts-delayed-delta --source http://gemcutter.org</code></pre> In your @environment.rb@ file, with the rest of your gem dependencies: <pre><code>config.gem 'ts-delayed-delta', :lib => 'thinking_sphinx/deltas/delayed_delta' :version => '>= 1.0.0', :source => 'http://gemcutter.org'</code></pre> And add the following line to the bottom of your @Rakefile@: <pre><code>require 'thinking_sphinx/deltas/delayed_delta/tasks'</code></pre> If this is your first time running Delayed Job, then you're going to need the jobs table migration as well: <pre><code>script/generate delayed_job</code></pre> For the indexes you want to use this delta approach, make sure you set that up in their @define_index@ blocks. <pre><code>define_index do # ... set_property :delta => :delayed end</code></pre> If you've never used delta indexes before, you'll want to add the boolean column named delta to each model that is using the approach. <pre><code>def self.up add_column :articles, :delta, :boolean, :default => true, :null => false end</code></pre> h2. Usage Once you've got it all set up, all you need to do is make sure that the delayed job process is running - either by Delayed Job's built-in approach, or Thinking Sphinx's custom rake task: <pre><code>rake thinking_sphinx:delayed_delta</code></pre> There's also a short name for the same task, to save your fingers some effort: <pre><code>rake ts:dd</code></pre> h2. Contributors * "Ryan Schlesinger":http://github.com/ryansch (Allowing installs as a plugin) * "Maximilian Schulz":http://max.jungeelite.de (Ensuring compatibility with Bundler) h2. Copyright Copyright (c) 2009 Pat Allan, and released under an MIT Licence.
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ts-delayed-delta-1.0.4 | README.textile |
ts-delayed-delta-1.0.3 | README.textile |