Skip to content

Commit

Permalink
support queries by subject. datacite/datacite#460
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Jan 3, 2019
1 parent ccd8fab commit 5b67bda
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/controllers/dois_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def index
person_id: params[:person_id],
resource_type_id: params[:resource_type_id],
schema_version: params[:schema_version],
subject: params[:subject],
link_check_status: params[:link_check_status],
link_check_has_schema_org: params[:link_check_has_schema_org],
link_check_body_has_pid: params[:link_check_body_has_pid],
Expand Down
1 change: 1 addition & 0 deletions app/models/concerns/indexable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def query(query, options={})
must << { term: { "author.id" => "https://orcid.org/#{options[:person_id]}" }} if options[:person_id].present?
must << { range: { created: { gte: "#{options[:created].split(",").min}||/y", lte: "#{options[:created].split(",").max}||/y", format: "yyyy" }}} if options[:created].present?
must << { term: { schema_version: "http://datacite.org/schema/kernel-#{options[:schema_version]}" }} if options[:schema_version].present?
must << { terms: { "subjects.subject": options[:subject].split(",") }} if options[:subject].present?
must << { term: { source: options[:source] }} if options[:source].present?
must << { term: { "landing_page.status": options[:link_check_status] }} if options[:link_check_status].present?
must << { exists: { field: "landing_page.checked" }} if options[:link_checked].present?
Expand Down

0 comments on commit 5b67bda

Please sign in to comment.