Sha256: e0e889a89c9f7e756e99e4f424e47812df2f10609c218d9fbd4a09df57a28faf

Contents?: true

Size: 389 Bytes

Versions: 2

Compression:

Stored size: 389 Bytes

Contents

require "supernova/solr_criteria"

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.2.1 lib/supernova/solr.rb
supernova-0.2.0 lib/supernova/solr.rb