Skip to content

v3.1.2

Compare
Choose a tag to compare
@pat pat released this 04 Nov 06:51
· 583 commits to develop since this release

Upgrading

There's no modification required if you're upgrading from v3.1.1. Of course, if you're using something older than that, reading the earlier release notes is highly recommended.

New Features

Nothing massive, but a few helpful new things, in order of when they were committed:

Cast Sphinx document ids as 64-bit integers

To ensure document ids are reliably 64-bit integers (aka bigints), set big_document_ids to true either via set_property in a specific index or in config/thinking_sphinx.yml for each appropriate environment.

Real-time index callbacks accept blocks

This is useful when your callback refers to multiple objects via an association and you want to ensure certain data is available by preloading:

ThinkingSphinx::RealTime.callback_for(:post) { |user| user.posts.include(:category) }

Rake task for Sphinx status

ts:status lets you know if Sphinx is running or not.

Allow binlog_path to be blank

Courtesy of @uhlenbrock, this allows you to disable binlog files if you're not using real-time indices - just set binlog_path to a blank string for each environment in config/thinking_sphinx.yml.

Custom location paths for index files

If you want to change where specific indices are located, instead of all of them, you can supply a :path option to ThinkingSphinx::Index.define. This will be the directory where the index files will be stored, and an absolute path is expected.

Changes to behaviour

  • rebuild task uses clear between stopping the daemon and indexing.
  • Default the Capistrano TS Rails environment to use rails_env, and then fall back to stage.
  • Paginate records by 1000 results at a time when flagging as deleted.
  • Log indices that aren't processed due to guard files existing.
  • Raise an exception when a populated search query is modified (as it can't be requeried).
  • regenerate task now only deletes index files for real-time indices.

Bug Fixes

  • Clear connections when raising connection errors.
  • Some association fixes for Rails 4.1.
  • Models with more than one index have correct facet counts (using Sphinx 2.1.x or newer).
  • Field weights and other search options are now respected from set_property.
  • Convert database setting keys to symbols for consistency with Rails (@dimko).
  • Use STI base class for polymorphic association replacements.
  • Don't update real-time indices for objects that are not persisted (Chance Downs).
  • Ensure indexing guard files are removed when an exception is raised (Bobby Uhlenbrock).