Module: ThinkingSphinx::ActiveRecord::Base::ClassMethods
- Defined in:
- lib/thinking_sphinx/active_record/base.rb
Instance Method Summary collapse
- #sphinx_facets(query = nil, options = {}) ⇒ Object
- #sphinx_search(query = nil, options = {}) ⇒ Object
- #sphinx_search_count(query = nil, options = {}) ⇒ Object
- #sphinx_search_for_ids(query = nil, options = {}) ⇒ Object
- #sphinx_search_none ⇒ Object
Instance Method Details
#sphinx_facets(query = nil, options = {}) ⇒ Object
43 44 45 |
# File 'lib/thinking_sphinx/active_record/base.rb', line 43 def sphinx_facets(query = nil, = {}) merge_search ThinkingSphinx.facets, query, end |
#sphinx_search(query = nil, options = {}) ⇒ Object
47 48 49 |
# File 'lib/thinking_sphinx/active_record/base.rb', line 47 def sphinx_search(query = nil, = {}) merge_search ThinkingSphinx.search, query, end |
#sphinx_search_count(query = nil, options = {}) ⇒ Object
51 52 53 |
# File 'lib/thinking_sphinx/active_record/base.rb', line 51 def sphinx_search_count(query = nil, = {}) search_for_ids(query, ).total_entries end |
#sphinx_search_for_ids(query = nil, options = {}) ⇒ Object
55 56 57 58 59 |
# File 'lib/thinking_sphinx/active_record/base.rb', line 55 def sphinx_search_for_ids(query = nil, = {}) ThinkingSphinx::Search::Merger.new( search(query, ) ).merge! nil, :ids_only => true end |
#sphinx_search_none ⇒ Object
61 62 63 |
# File 'lib/thinking_sphinx/active_record/base.rb', line 61 def sphinx_search_none merge_search ThinkingSphinx.search, nil, none: true end |