module ActiveFedora::Model::ClassMethods

def find_by_solr(query, args={})

connection instance.
Args is an options hash, which is passed into the SolrService

objects, but rather an array of SolrResults.
Note that this method does _not_ return ActiveFedora::Model

a pid based search (id:query).
by Solr). If the query is any other string, this method simply does
of self.type (based on active_fedora_model_s as indexed
If query is :all, this method will query Solr for all instances
def find_by_solr(query, args={})
  if query == :all
    escaped_class_name = self.name.gsub(/(:)/, '\\:')
    SolrService.instance.conn.query("active_fedora_model_s:#{escaped_class_name}", args)
  elsif query.class == String
    escaped_id = query.gsub(/(:)/, '\\:')          
    SolrService.instance.conn.query("#{SOLR_DOCUMENT_ID}:#{escaped_id}", args)
  end
end