Sha256: ed22ea0d2660cc1a4242dec7aab21bf2c1df11441f3d039d30531116e15e305d
Contents?: true
Size: 563 Bytes
Versions: 31
Compression:
Stored size: 563 Bytes
Contents
# # This has to be included after the searchable block in your model # module Ext module DelayedIndexing def self.included(base) base.extend ClassMethods base.class_eval do handle_asynchronously :solr_index handle_asynchronously :solr_index! after_commit { Sunspot.delay.commit } end end module ClassMethods def search_index(query, organization) self.search do fulltext query with(:organization_id).equal_to(organization.id) end.results end end end end
Version data entries
31 entries across 31 versions & 1 rubygems