Module: Ripple::Searchable::ClassMethods
- Defined in:
- lib/ripple_searchable/searchable.rb
Instance Attribute Summary collapse
-
#criteria ⇒ Object
Returns the value of attribute criteria.
Instance Method Summary collapse
- #index_after_save! ⇒ Object
-
#search(*args) ⇒ Object
Performs a search via the Solr interface.
Instance Attribute Details
#criteria ⇒ Object
Returns the value of attribute criteria.
30 31 32 |
# File 'lib/ripple_searchable/searchable.rb', line 30 def criteria @criteria end |
Instance Method Details
#index_after_save! ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/ripple_searchable/searchable.rb', line 43 def index_after_save! class_eval do after_save do |m| Ripple.client.index(m.class.bucket_name, m.attributes.reject {|k,v| v.nil?}.merge(id: m.id)) end end end |
#search(*args) ⇒ Object
Performs a search via the Solr interface.
35 36 37 |
# File 'lib/ripple_searchable/searchable.rb', line 35 def search(*args) Ripple.client.search(self.bucket_name, *args) end |