Changelog History
Page 2
-
v3.4.1 Changes
August 29, 2017β¬οΈ Upgrading
π No breaking or major changes, just two small fixes.
π Changes to behaviour
- Errors with "Lost connection to MySQL server" are now treated as connection errors (Manuel Schnitzer).
π Bug fixes
- Index normalisation will now work even when index model tables don't exist.
-
v3.4.0 Changes
August 28, 2017β¬οΈ Upgrading
π There are a few significant changes in this release. There's nothing that's going to break your code, but there are some deprecations (and thus, there will be breaking in later releases), so reading through is highly recommended.
Basic type checking for attribute filters.
π Given Riddle now quotes string values in filters (because Sphinx now supports filtering on string attributes), we need to be a little more careful about attribute filter values coming in through params. In the past, Riddle would presume any string value was not actually a string, and that's no longer a safe presumption.
π As of this release, Thinking Sphinx will do its best to cast your filter values to their appropriate types, but it's not going to be perfect, and this will be removed in a future release. So, best to do the casting yourself:
Model.search :with =\> {:foo\_id =\> params[:foo\_id]}# should become:Model.search :with =\> {:foo\_id =\> params[:foo\_id].to\_i}
This is likely going to crop up any time you're using params data in filters, because they'll always be strings.
π If you're confident that you're casting all filter values to their appropriate types, you can remove the search middleware that's attempting to auto-cast (and thus, get a bit of a speed boost) by putting the following in an initialiser:
ThinkingSphinx::Middlewares::DEFAULT.delete( ThinkingSphinx::Middlewares::AttributeTyper)ThinkingSphinx::Middlewares::RAW\_ONLY.delete( ThinkingSphinx::Middlewares::AttributeTyper)ThinkingSphinx::Middlewares::IDS\_ONLY.delete( ThinkingSphinx::Middlewares::AttributeTyper)
β Warnings for unknown options in search calls.
π Thinking Sphinx will now output a warning to your logs when unexpected options are used in search queries.
If youβre adding your own middleware in or have something else that may allow for custom options, make sure you add them to
ThinkingSphinx::Search.valid_options
.π If you donβt want this behaviour to occur, you can remove the middleware from your stack by putting the following in an initialiser:
ThinkingSphinx::Middlewares::DEFAULT.delete( ThinkingSphinx::Middlewares::ValidOptions)ThinkingSphinx::Middlewares::RAW\_ONLY.delete( ThinkingSphinx::Middlewares::ValidOptions)ThinkingSphinx::Middlewares::IDS\_ONLY.delete( ThinkingSphinx::Middlewares::ValidOptions)
Unified Rake Tasks
Rake tasks are now unified, so the original tasks will operate on real-time indices as well. What this means is that
ts:generate
andts:regenerate
can be changed tots:index
andts:rebuild
. All standard tasks will perform their appropriate behaviours on all indices.If you wish to perform operations on specific types of indices, then there are now tasks available for that, including:
ts:sql:index
(the old behaviour ofts:index
)ts:sql:rebuild
(the old behaviour ofts:rebuild
)ts:rt:index
(the old behaviour ofts:generate
)ts:rt:rebuild
(the old behaviour ofts:regenerate
)
Minor Features
- Automatically use UTF8 in Sphinx for encodings that are extensions of UTF8 (such as
utf8mb4
). - π Allow generation of a single real-time index (Tim Brown) with the
INDEX_FILTER
environment variable.
π Changes to behaviour
- π Handle non-computable queries as parse errors.
- Don't search multi-table inheritance ancestors.
- 0οΈβ£ Set a default Sphinx connection timeout of 5 seconds.
- π Use saved_changes if it's available (in Rails 5.1+).
- β Add support for Ruby's frozen string literals feature.
- π² Display SphinxQL deletion statements in the log.
- π Allow for unsaved records when calculating document ids (and return nil).
- Delta callback logic now prioritises checking for high level settings rather than model changes.
π Bug Fixes
- Ensure ts:index now respects rake silent/quiet flags.
- π Use the base class of STI models for polymorphic join generation (via AndrΓ©s Cirugeda).
- π Fix multi-field conditions.
- π Fix handling of attached starts of Sphinx (via Henne Vogelsang).
- π Get bigint primary keys working in Rails 5.1.
- Always close the SphinxQL connection if Innertube's asking (via @cmaion).
- π Fix long SphinxQL query handling in JRuby.
- π Fix Sphinx connections in JRuby.
- Index normalisation now occurs consistently, and removes unneccesary sphinx_internal_class_name fields from real-time indices.
-
v3.3.0 Changes
December 13, 2016β¬οΈ 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 yourconfig/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 withafter_save
- though you should only use one! Also, if you're usingafter_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.
- 0οΈβ£ 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.
- 0οΈβ£ 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).