• Stars
    star
    73
  • Rank 418,664 (Top 9 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 14 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Manage delta indexes via Delayed Job for Thinking Sphinx

Delayed Deltas for Thinking Sphinx

Installation

This version works with Thinking Sphinx v1.5.0, v2.1.0 and v3.×.

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

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

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

gem 'ts-delayed-delta',
  :git    => 'git://github.com/pat/ts-delayed-delta.git',
  :branch => 'master',
  :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

For those still on pre-v3 versions of Thinking Sphinx, the delta option goes within the define_index block:

define_index do
  # ...

  set_property :delta => ThinkingSphinx::Deltas::DelayedDelta
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.

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-2018, 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.

More Repositories

1

thinking-sphinx

Sphinx/Manticore plugin for ActiveRecord/Rails
Ruby
1,620
star
2

combustion

Simple, elegant testing for Rails Engines
Ruby
674
star
3

gutentag

A good, simple, solid tagging extension for ActiveRecord.
Ruby
473
star
4

riddle

Ruby Client API for Sphinx
Ruby
136
star
5

thinking-sphinx-raspell

An add-on gem for spelling suggestions in Thinking Sphinx
Ruby
58
star
6

ts-datetime-delta

Manage delta indexes via datetime columns for Thinking Sphinx
Ruby
45
star
7

fakeweb-matcher

An RSpec matcher for the Fakeweb HTTP stubbing library
Ruby
37
star
8

sliver

A super simple, extendable Rack API.
Ruby
31
star
9

calendav

Interact with CalDAV via Ruby
Ruby
30
star
10

sphinx

Free open-source SQL full-text search engine
C++
26
star
11

active-matchers

Helpful rspec matchers for testing validations and associations.
Ruby
23
star
12

ginger

Run specs/tests multiple times through different gem versions
Ruby
22
star
13

render_api

Ruby interface for the render.com API.
Ruby
19
star
14

pat.github.com

HTML
17
star
15

railscamps.com

Rails Camps Website
HTML
15
star
16

pedantic

Pares text down to the words that matter
Ruby
14
star
17

pippin

A PayPal Rails Engine that handles IPNs
Ruby
14
star
18

drumknott-server

Server for storing static site search data.
Ruby
11
star
19

gyoza

Streamlined Editing for GitHub Pages
JavaScript
11
star
20

support-act

Encouraging people to buy albums alongside their streaming, to better support artists.
Ruby
11
star
21

not-a-mock

A cleaner and DRYer alternative to mocking and stubbing with RSpec.
Ruby
10
star
22

laughtrack

A festival buzz tracker
Ruby
10
star
23

joiner

Builds ActiveRecord joins from association paths
Ruby
7
star
24

numbr5

Thank-you bot for IRC (and maybe more)
Ruby
7
star
25

sphinx-tute

Project for the Sphinx Tutorial at RailsConf 2009
Ruby
6
star
26

sslocal-rb

Make local environment SSL as streamlined as possible.
Ruby
6
star
27

ruby-netcdf

Copy of source for ruby-netcdf gem, with tweak for MRI 2.0.0
C
6
star
28

enkoder

An extension to the Rails TextHelper module that can be used to protect email addresses (or other information) by obfuscating them using JavaScript code. Written by Dan Benjamin.
Ruby
6
star
29

nudge

Simple Static Site Deployer via Git
Ruby
6
star
30

radiant-tiny-mce

Tiny MCE Filter and Asset Management (via Paperclipped)
5
star
31

tramampoline

Trampoline Website, now with registrations
HTML
5
star
32

thin-glazed

SSL Proxy for HTTP Thin servers
Ruby
5
star
33

ts-sidekiq-delta

Thinking Sphinx - Sidekiq Deltas
Ruby
5
star
34

gzipped_tar

In-memory reading/writing of .tar.gz files
Ruby
5
star
35

radiant-layout-layer

Automatically create Radiant layouts based on HTML files in other extensions
Ruby
5
star
36

inkan

Unique file markers for tracking whether files have been changed.
Ruby
4
star
37

vcr_assistant

Manages VCR cassettes and set-up logic for RSpec.
Ruby
4
star
38

beer-tracker

Website/API partner for Numbr5
3
star
39

chargify-loops

A Rails Engine for Chargify Webhooks
Ruby
3
star
40

sslocal-js

Make local environment SSL as streamlined as possible.
JavaScript
3
star
41

laughtrack-couch

Couch Logic and Views for LaughTrack
JavaScript
2
star
42

postie

Ruby
2
star
43

spreadsheet-excel

Resurrecting an old gem.
Ruby
2
star
44

babushka-deps

Babushka Dependencies
Ruby
2
star
45

radiant-publican

Automatically copy Radiant extensions' public files on every load for the development environment
2
star
46

.js

JavaScript
1
star
47

shithead

A card game
Ruby
1
star
48

bb8

Keeps Terraform state and variables secret per environment, with help from Voltos
Ruby
1
star
49

lipwig

Write group emails in Markdown, send via Postmark or SMTP.
Ruby
1
star
50

ruby-event-guides

Tips and thoughts about running Rails Camps and RubyConf AU.
1
star
51

thinking-sphinx-examples

Example of advanced search form.
Ruby
1
star
52

trampolinemelb.com

Website for Trampoline, a cross-discipline unconference.
1
star
53

livecal

Translate ical/ics files into actual calendars and events
Ruby
1
star
54

isnotagithubberyet

Because Jan said I should - and who needs a better reason than that?
Ruby
1
star
55

resque-crashlog

Resque failure handler for crashlog.io
Ruby
1
star
56

lu-tze

Automated Backup Helper for Heroku
Ruby
1
star
57

json_template_benchmarking

Ruby
1
star