Skip to content
notch8 edited this page Sep 13, 2010 · 3 revisions

Tanning Bed doesn’t require ActiveRecord or any other ORM. It can be used by any Ruby class.

class Model
  include ::TanningBed # This gets you the library for a given model file
  1. You can also do batch adding by moving solr_add to a script
  2. tailor to what ever you callback structure is
    save_callback :after, :solr_add
    destroy_callback :after, :solr_delete
  1. This is just an array of method names to call on your model.
  2. In the couchdb example self.keys returns all the Couchdb datafields.
  3. Here we remove one we don’t want to index and then add some non-field
  4. methods we want to index
    def solr_keys
    keys – [“providers”] + [“discipline_name”, “category_names”, “available_provider_names”, “certifications_facet”, “countries_facet”, “starts_with_facet”] + WareAnnotation.annotation_list
    end
    end
Clone this wiki locally