Class ThinkingSphinx::Search
In: lib/thinking_sphinx/search.rb
Parent: Object

Once you‘ve got those indexes in and built, this is the stuff that matters - how to search! This class provides a generic search interface - which you can use to search all your indexed models at once. Most times, you will just want a specific model‘s results - to search and search_for_ids methods will do the job in exactly the same manner when called from a model.

Methods

Constants

CoreMethods = %w( == class class_eval extend frozen? id instance_eval instance_of? instance_values instance_variable_defined? instance_variable_get instance_variable_set instance_variables is_a? kind_of? member? method methods nil? object_id respond_to? send should type )
SafeMethods = %w( partition private_methods protected_methods public_methods send class )
HashOptions = [:conditions, :with, :without, :with_all]
ArrayOptions = [:classes, :without_ids]

Attributes

args  [R] 
options  [R] 

Public Class methods

Deprecated. Use ThinkingSphinx.count

Deprecated. Use ThinkingSphinx.facets

Deprecated. Use ThinkingSphinx.search

Deprecated. Use ThinkingSphinx.search_for_ids

Deprecated. Use ThinkingSphinx.search_for_ids

Public Instance methods

The current page number of the result set. Defaults to 1 if no page was explicitly requested.

@return [Integer]

each_with_group_and_count(&block)

The Sphinx-reported error, if any.

@return [String, nil]

Indication of whether the request resulted in an error from Sphinx.

@return [Boolean] true if Sphinx reports query error

The next page number of the result set. If there are no more pages available, nil is returned.

@return [Integer, nil]

The current page‘s offset, based on the number of records per page. Or explicit :offset if given.

@return [Integer]

page_count()

Alias for total_pages

The amount of records per set of paged results. Defaults to 20 unless a specific page size is requested.

@return [Integer]

Indication of whether the request has been made to Sphinx for the search query.

@return [Boolean] true if the results have been requested.

The previous page number of the result set. If this is the first page, then nil is returned.

@return [Integer, nil]

Query time taken

@return [Integer]

Returns true if the Search object or the underlying Array object respond to the requested method.

@param [Symbol] method The method name @return [Boolean] true if either Search or Array responds to the method.

The query result hash from Riddle.

@return [Hash] Raw Sphinx results

The total number of search results available.

@return [Integer]

The total number of pages available if the results are paginated.

@return [Integer]

The Sphinx-reported warning, if any.

@return [String, nil]

Indication of whether the request resulted in a warning from Sphinx.

@return [Boolean] true if Sphinx reports query warning

[Validate]