Skip to content

Commit

Permalink
Merge branch 'master' of github.com:datacite/lupo
Browse files Browse the repository at this point in the history
  • Loading branch information
richardhallett committed Aug 19, 2021
2 parents 4191362 + b33ef06 commit da3bb67
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
12 changes: 6 additions & 6 deletions app/graphql/types/person_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,20 +182,20 @@ def works(**args)

def view_count
args = { first: 0 }
r = response(args)
r.response.aggregations.view_count.value.to_i
@r = response(args) if @r.nil?
@r.response.aggregations.view_count.value.to_i
end

def download_count
args = { first: 0 }
r = response(args)
r.response.aggregations.download_count.value.to_i
@r = response(args) if @r.nil?
@r.response.aggregations.download_count.value.to_i
end

def citation_count
args = { first: 0 }
r = response(args)
r.response.aggregations.citation_count.value.to_i
@r = response(args) if @r.nil?
@r.response.aggregations.citation_count.value.to_i
end

def response(**args)
Expand Down
2 changes: 1 addition & 1 deletion db/seeds/development/base.seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
:client,
provider: provider,
symbol: ENV["MDS_USERNAME"],
password: ENV["MDS_PASSWORD"],
password_input: ENV["MDS_PASSWORD"],
)
if Prefix.where(uid: "10.14454").blank?
prefix = FactoryBot.create(:prefix, uid: "10.14454")
Expand Down
21 changes: 20 additions & 1 deletion lib/tasks/elasticsearch.rake
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,29 @@ namespace :elasticsearch do
fail "These tasks can only be used in the development enviroment" if Rails.env.production?

Rake::Task["provider:create_index"].invoke
Rake::Task["provider:create_alias"].invoke

Rake::Task["client:create_index"].invoke
Rake::Task["client:create_alias"].invoke

Rake::Task["prefix:create_index"].invoke
Rake::Task["prefix:create_alias"].invoke

Rake::Task["provider_prefix:create_index"].invoke
Rake::Task["provider_prefix:create_alias"].invoke

Rake::Task["client_prefix:create_index"].invoke
Rake::Task["doi:create_index"].invoke
Rake::Task["client_prefix:create_alias"].invoke

Rake::Task["other_doi:create_index"].invoke
Rake::Task["other_doi:create_alias"].invoke

Rake::Task["datacite_doi:create_index"].invoke
Rake::Task["datacite_doi:create_alias"].invoke

Rake::Task["event:create_index"].invoke
Rake::Task["event:create_alias"].invoke

Rake::Task["activity:create_index"].invoke
end

Expand All @@ -26,6 +43,8 @@ namespace :elasticsearch do
Rake::Task["prefix:delete_index"].invoke
Rake::Task["provider_prefix:delete_index"].invoke
Rake::Task["client_prefix:delete_index"].invoke
Rake::Task["other_doi:delete_index"].invoke
Rake::Task["datacite_doi:delete_index"].invoke
Rake::Task["doi:delete_index"].invoke
Rake::Task["event:delete_index"].invoke
Rake::Task["activity:delete_index"].invoke
Expand Down

0 comments on commit da3bb67

Please sign in to comment.