Sha256: b81192700ecbc66924a0b59fb0fa1238b3082dbdc896b99b586c8a2d369da7e1

Contents?: true

Size: 422 Bytes

Versions: 2

Compression:

Stored size: 422 Bytes

Contents

require "supernova/solr_criteria"
require "supernova/solr_indexer"

module Supernova::Solr
  class << self
    attr_accessor :url
    
    def connection
      @connection ||= RSolr.connect(:url => self.url)
    end
    
    def truncate!
      connection.delete_by_query("*:*")
    end
  end
  
  def self.included(base)
    base.extend(Supernova::ClassMethods)
    base.criteria_class = Supernova::SolrCriteria
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
supernova-0.3.0 lib/supernova/solr.rb
supernova-0.2.2 lib/supernova/solr.rb