Giter Site home page Giter Site logo

ts-delayed-delta's Introduction

Delayed Deltas for Thinking Sphinx

Installation

You’ll need Thinking Sphinx 1.3.0 or later, and Delayed Job as well. The latter is flagged as a dependency.

gem install ts-delayed-delta --source http://gemcutter.org

In your environment.rb file, with the rest of your gem dependencies:

config.gem 'ts-delayed-delta',
  :lib     => 'thinking_sphinx/deltas/delayed_delta',
  :version => '>= 1.0.0',
  :source  => 'http://gemcutter.org'

And add the following line to the bottom of your Rakefile:

require 'thinking_sphinx/deltas/delayed_delta/tasks'

If this is your first time running Delayed Job, then you’re going to need the jobs table migration as well:

script/generate delayed_job

For the indexes you want to use this delta approach, make sure you set that up in their define_index blocks.

define_index do
  # ...

  set_property :delta => :delayed
end

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.

def self.up
  add_column :articles, :delta, :boolean, :default => true, :null => false
end

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:

rake thinking_sphinx:delayed_delta

There’s also a short name for the same task, to save your fingers some effort:

rake ts:dd

Contributors

Copyright

Copyright © 2009-2010 Pat Allan, and released under an MIT Licence.

ts-delayed-delta's People

Contributors

pat avatar benhutton avatar dgoodlad avatar map7 avatar ryansch avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.