Skip to content

Commit

Permalink
query by registration year
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Oct 15, 2018
1 parent fa38299 commit 7ff99e3
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 @@ -105,6 +105,7 @@ def index
state: params[:state],
year: params[:year],
created: params[:created],
registered: params[:registered],
provider_id: params[:provider_id],
client_id: params[:client_id],
prefix: params[:prefix],
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 @@ -120,6 +120,7 @@ def query(query, options={})
must << { term: { prefix: options[:prefix] }} if options[:prefix].present?
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 << { range: { registered: { gte: "#{options[:registered].split(",").min}||/y", lte: "#{options[:registered].split(",").max}||/y", format: "yyyy" }}} if options[:registered].present?
must << { term: { schema_version: "http://datacite.org/schema/kernel-#{options[:schema_version]}" }} if options[:schema_version].present?
must << { term: { source: options[:source] }} if options[:source].present?

Expand Down

0 comments on commit 7ff99e3

Please sign in to comment.