Giter Club home page Giter Club logo

ts-delayed-delta's Introduction

Delayed Deltas for Thinking Sphinx

Installation

This version requires Thinking Sphinx 3.x (currently the edge branch) and Delayed Job 3.×.

In your Gemfile, it’ll likely look something like this:

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

Or, if you’re referring directly to the git repository:

gem 'ts-delayed-delta',
  :git    => 'git://github.com/pat/ts-delayed-delta.git',
  :branch => 'edge',
  :ref    => 'use-latest-commit-here'

And given this gem’s built for Delayed Job, we’re presuming you’ve got that set up (with the database table), and you know how to run it. This gem no longer provides a custom task for that purpose – there’s no need.

Usage

In your index definitions, make sure you set the :delta setting to ThinkingSphinx::Deltas::DelayedDelta:

ThinkingSphinx::Index.define :book, :with => :active_record, :delta => ThinkingSphinx::Deltas::DelayedDelta do
  # ...
end

If you’ve never used delta indices before, you’ll want to add the boolean column named delta to each model that is using the approach. It probably doesn’t hurt to add an index to that column as well.

add_column :books, :delta, :boolean, :default => true, :null => false
add_index  :books, :delta

And that’s pretty much it. Make sure Delayed Job is running, and it’ll take care of the jobs to keep your Sphinx indices up to date.

Please keep in mind that you need to run the Delayed Job workers on the same machine as Sphinx, as direct access to Sphinx files (and the Sphinx command-line tools) is essential.

Limitations

This version of the gem is built for Ruby 1.9 and Rails 3.1 or newer, just like Thinking Sphinx 3.

Contributing

Contributions are very much welcome – but keep in mind the following:

  • Keep patches in a separate branch
  • Don’t mess with the version number. I’ll take care of that when the patch is merged in.
  • Please write tests – currently, there’s only acceptance tests in place, because the underlying code is simple enough. If you get stuck into anything complex, unit tests are a smart move.

Contributors

Copyright

Copyright © 2009-2012, Thinking Sphinx Delayed Deltas (ts-delayed-delta) is developed and maintained by Pat Allan, and is released under the open MIT Licence. Many thanks to all who have contributed patches.

ts-delayed-delta's People

Contributors

pat avatar manjunath-nm89 avatar yob avatar aafaq-hassan avatar benhutton avatar dgoodlad avatar enrico avatar ledermann avatar jviney avatar michaelklishin avatar map7 avatar ryansch avatar

Watchers

 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.