GithubHelp home page GithubHelp logo

designerpages / ts-resque-delta-priority Goto Github PK

View Code? Open in Web Editor NEW

This project forked from agibralter/ts-resque-delta

0.0 11.0 0.0 130 KB

ThinkingSphinx + Resque delta indexing.

License: MIT License

Ruby 100.00%

ts-resque-delta-priority'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 and resque.

Currently, you'll need Thinking Sphinx v1.5.0 (for Rails 2), v2.1.0 (for Rails 3), or - ideally - v3.0.3 or newer (for Rails 3.1 onwards). If you're on a version of Thinking Sphinx that's too old, you better go upgrade - but otherwise, add ts-resque-delta to your Gemfile file with the rest of your gem dependencies:

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

Add the delta property to index definition. If you're using Thinking Sphinx v3, then it'll look something like this:

ThinkingSphinx::Index.define(:article,
  :with  => :active_record,
  :delta => ThinkingSphinx::Deltas::ResqueDelta
) do
  # fields and attributes and so on...
end

But if you're still using v1.5 or v2.1, you'll want the following:

define_index do
  # fields and attributes and so on...

  set_property :delta => ThinkingSphinx::Deltas::ResqueDelta
end

If you've never used delta indexes before, you'll need to add the boolean column named :delta to each table for indexed models. A database index for that column is also recommended.

def change
  add_column :articles, :delta, :boolean, :default => true, :null => false
  add_index  :articles, :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-2014 Aaron Gibralter and Pat Allan, and released under an MIT Licence.

ts-resque-delta-priority's People

Contributors

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

Watchers

spike grobstein avatar Robert Jenkins avatar t2 avatar James Cloos avatar Jesús Enrique Gutiérrez Cortazar avatar Tom Metzger avatar Liz Kalina avatar Kevin Cheng avatar Ariel Parra Inukai avatar  avatar  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.