Sha256: 39c22ddca712855556167e286bdb269e88d473c260e282a7186deaa5bfea0df3
Contents?: true
Size: 1.79 KB
Versions: 37
Compression:
Stored size: 1.79 KB
Contents
module ThinkingSphinx module ActiveRecord # This module covers the specific model searches - but the syntax is # exactly the same as the core Search class - so use that as your refence # point. # module Search def self.included(base) base.class_eval do class << self # Searches for results that match the parameters provided. Will only # return the ids for the matching objects. See # ThinkingSphinx::Search#search for syntax examples. # def search_for_ids(*args) options = args.extract_options! options[:class] = self args << options ThinkingSphinx::Search.search_for_ids(*args) end # Searches for results limited to a single model. See # ThinkingSphinx::Search#search for syntax examples. # def search(*args) options = args.extract_options! options[:class] = self args << options ThinkingSphinx::Search.search(*args) end def search_count(*args) options = args.extract_options! options[:class] = self args << options ThinkingSphinx::Search.count(*args) end def search_for_id(*args) options = args.extract_options! options[:class] = self args << options ThinkingSphinx::Search.search_for_id(*args) end def facets(*args) options = args.extract_options! options[:class] = self args << options ThinkingSphinx::Search.facets(*args) end end end end end end end
Version data entries
37 entries across 37 versions & 8 rubygems