Skip to content

Commit

Permalink
query by consortium_lead. datacite/bracco#210
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Jul 26, 2019
1 parent da4ecc3 commit cf93e01
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/controllers/providers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def index
exclude_registration_agencies: params[:exclude_registration_agencies],
year: params[:year],
region: params[:region],
consortium_lead: params[:consortium_lead],
member_type: params[:member_type],
organization_type: params[:organization_type],
focus_area: params[:focus_area],
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 @@ -167,6 +167,7 @@ def query(query, options={})
if self.name == "Provider"
must << { range: { created: { gte: "#{options[:year].split(",").min}||/y", lte: "#{options[:year].split(",").max}||/y", format: "yyyy" }}} if options[:year].present?
must << { term: { region: options[:region].upcase }} if options[:region].present?
must << { term: { consortium_lead_id: options[:consortium_lead].upcase }} if options[:consortium_lead].present?
must << { term: { member_type: options[:member_type] }} if options[:member_type].present?
must << { term: { organization_type: options[:organization_type] }} if options[:organization_type].present?
must << { term: { focus_area: options[:focus_area] }} if options[:focus_area].present?
Expand Down

0 comments on commit cf93e01

Please sign in to comment.