Skip to content

Commit

Permalink
Only ask solr for 1 row when using find
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcolvar committed Sep 17, 2024
1 parent b8fe23e commit 7b0086c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/speedy_af/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ def config(model, &block)
end

def find(id, opts = {})
where(%(id:"#{id}"), opts).first
where(%(id:"#{id}"), opts.merge(rows: 1)).first
end

def where(query, opts = {})
docs = ActiveFedora::SolrService.query(query, rows: SOLR_ALL)
docs = ActiveFedora::SolrService.query(query, rows: opts[:rows] || SOLR_ALL)
from(docs, opts)
end

Expand Down

0 comments on commit 7b0086c

Please sign in to comment.