Skip to content

v3.3.0

Compare
Choose a tag to compare
@pat pat released this 13 Dec 01:17
· 432 commits to develop since this release

Upgrading

There are no breaking changes in this release - upgrading should be a painless process (but do let me know if that's not the case).

A big thank you to all contributors of this release - in particular, Julio Monteiro and Asaf Barton.

New Features

Running the ts:generate task loads model instances in batches of 1000. You can customise this globally by setting the batch_size option in your config/thinking_sphinx.yml file per environment.

Also, if you prefer to have data persisted to your real-time indices after the database transaction is committed, the callback helper works with after_commit just like it does with after_save - though you should only use one! Also, if you're using after_commit, that means you can't wrap tests that involve Sphinx in transactions.

class Article < ActiveRecord::Base
  # ...

  after_commit ThinkingSphinx::RealTime.callback_for(:article)

  # ...
end

Changes to behaviour

  • Memoize the default primary keys per context to improve performance.
  • Added custom exception class for invalid database adapters, rather than relying on Ruby's default exceptions.
  • Sort engine paths for loading indices to ensure they're consistent.
  • The ts:start and ts:stop rake tasks default to verbose, and respect Rake's quiet and silent flags, so those are the recommended approach for getting the output you desire.
  • Use Riddle's reworked command interface for interacting with Sphinx's command-line tools.
  • Delta indexing is now quiet by default (rather than verbose).
  • Only toggle the delta value if the record has changed or is new (rather than on every single save call).

Bug Fixes

  • Ensure custom primary key columns are handled consistently (Julio Monteiro).
  • Fixed handling of multiple field tokens in wildcarding logic.
  • Improved Rails 5 / JRuby support.
  • Check search query length and raise an exception if they are too long for Sphinx.
  • Don't load ActiveRecord earlier than necessary. This avoids loading Rails out of order, which caused problems with Rails 5.
  • Load indices before deleting index files, to ensure the files are actually found and deleted.
  • Add an explicit source method in the SQLQuery Builder instead of relying on method missing, thus avoiding any global methods named 'source' (Asaf Bartov).