lib/ddr/models/solr_document.rb in ddr-models-2.4.12 vs lib/ddr/models/solr_document.rb in ddr-models-2.4.13
- old
+ new
@@ -10,11 +10,10 @@
class NotFound < Error; end
module ClassMethods
def find(pid_or_uri)
- pid = pid_or_uri.sub(/\Ainfo:fedora\//, "")
- query = Ddr::Index::QueryBuilder.build { |q| q.id(pid) }
+ query = Ddr::Index::Query.new { id pid_or_uri.sub(/\Ainfo:fedora\//, "") }
if doc = query.docs.first
return doc
end
raise NotFound, "SolrDocument not found for \"#{pid_or_uri}\"."
end