Giter Site home page Giter Site logo

ts-resque-delta's Introduction

Delayed Deltas for Thinking Sphinx (with Resque)

Build Status

This code is HEAVILY borrowed from ts-delayed-delta.

Installation

This gem depends on the following gems: thinking-sphinx, resque, and resque-lock-timeout.

gem install ts-resque-delta

Add ts-resque-delta to your Gemfile file, with the rest of your gem dependencies:

gem 'ts-resque-delta', '~> 2.1'

If you're using Rails 3, the rake tasks will automatically be loaded by Rails. If you're using Rails 2, add the following line to your Rakefile:

require 'thinking_sphinx/deltas/resque_delta/tasks'

Add the delta property to each define_index block:

define_index do
  # ...
  set_property :delta => ThinkingSphinx::Deltas::ResqueDelta
end

If you've never used delta indexes before, you'll want to add the boolean column named :delta to each model's table (note, you must set the :default value to true):

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

Also, I highly recommend adding a MySQL index to the table of any model using delta indexes. The Sphinx indexer uses WHERE table.delta = 1 whenever the delta indexer runs and ... = 0 whenever the normal indexer runs. Having the MySQL index on the delta column will generally be a win:

def self.up
  # ...
  add_index :foos, :delta
end

Usage

Once you've got it all set up, all you need to do is make sure that the Resque worker is running. You can do this by specifying the :ts_delta queue when running Resque:

QUEUE=ts_delta,other_queues rake resque:work

Contributors (for ts-resque-delta)

Original Contributors (for ts-delayed-delta)

Copyright

Copyright (c) 2011 Aaron Gibralter, and released under an MIT Licence.

ts-resque-delta's People

Contributors

agibralter avatar jmonteiro avatar ketzusaka avatar pat avatar ryansch avatar softbrada avatar taf2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

atipugin rahimsiz

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.