Module ThinkingSphinx::ActiveRecord
In: lib/thinking_sphinx/active_record.rb
lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb
lib/thinking_sphinx/active_record/delta.rb
lib/thinking_sphinx/active_record/scopes.rb
lib/thinking_sphinx/active_record/attribute_updates.rb
lib/thinking_sphinx/active_record/has_many_association.rb

Core additions to ActiveRecord models - define_index for creating indexes for models. If you want to interrogate the index objects created for the model, you can use the class-level accessor :sphinx_indexes.

Methods

Classes and Modules

Module ThinkingSphinx::ActiveRecord::AttributeUpdates
Module ThinkingSphinx::ActiveRecord::ClassMethods
Module ThinkingSphinx::ActiveRecord::Delta
Module ThinkingSphinx::ActiveRecord::HasManyAssociation
Module ThinkingSphinx::ActiveRecord::HasManyAssociationWithScopes
Module ThinkingSphinx::ActiveRecord::Scopes

Attributes

excerpts  [RW] 
matching_fields  [RW] 
sphinx_attributes  [RW] 
sphinx_index_blocks  [RW] 

Public Class methods

The above method to_crc32s is dependant on the subclasses being loaded consistently After a reset_subclasses is called (during a Dispatcher.cleanup_application in development) Our subclasses will be lost but our context will not reload them for us.

We reset the context which causes the subclasses to be reloaded next time the context is called.

Generate a unique CRC value for the model‘s name, to use to determine which Sphinx documents belong to which AR records.

Really only written for internal use - but hey, if it‘s useful to you in some other way, awesome.

Public Instance methods

Returns the unique integer id for the object. This method uses the attribute hash to get around ActiveRecord always mapping the id method to whatever the real primary key is (which may be a unique string hash).

@return [Integer] Unique record id for the purposes of Sphinx.

[Validate]