Skip to content

Commit

Permalink
use elasticSearchLoader rather than Es query
Browse files Browse the repository at this point in the history
  • Loading branch information
kjgarza committed Mar 4, 2020
1 parent ccccfcb commit e70c3d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/graphql/types/query_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def people(query: nil, first: nil)
def creative_works(query: nil, ids: nil, client_id: nil, provider_id: nil, first: nil)
if ids.present?
dois = ids.split(",").map { |i| doi_from_url(i) }
Doi.find_by_ids(dois, page: { number: 1, size: first }).results.to_a
ElasticsearchLoader.for(Doi).load_many(dois)
else
Doi.query(query, client_id: client_id, provider_id: provider_id, state: "findable", page: { number: 1, size: first }).results.to_a
end
Expand Down

0 comments on commit e70c3d4

Please sign in to comment.