Module | ThinkingSphinx::ActiveRecord::Scopes::ClassMethods |
In: |
lib/thinking_sphinx/active_record/scopes.rb
|
Similar to ActiveRecord‘s default_scope method Thinking Sphinx supports a default_sphinx_scope. For example:
default_sphinx_scope :some_sphinx_named_scope
The scope is automatically applied when the search method is called. It will only be applied if it is an existing sphinx_scope.
Returns true if the current Model has a default_sphinx_scope. Also checks if the default_sphinx_scope actually is a scope.
Similar to ActiveRecord‘s named_scope method Thinking Sphinx supports scopes. For example:
sphinx_scope(:latest_first) { {:order => 'created_at DESC, @relevance DESC'} }
Usage:
@articles = Article.latest_first.search 'pancakes'