diff --git a/app/controllers/providers_controller.rb b/app/controllers/providers_controller.rb index 7b5c55a8d..c99766d8b 100644 --- a/app/controllers/providers_controller.rb +++ b/app/controllers/providers_controller.rb @@ -25,7 +25,7 @@ def index elsif params[:ids].present? response = Provider.find_by_id(params[:ids], page: page, sort: sort) else - response = Provider.query(params[:query], year: params[:year], region: params[:region], organization_type: params[:organization_type], focus_area: params[:focus_area], page: page, sort: sort) + response = Provider.query(params[:query], year: params[:year], region: params[:region], member_type: params[:member_type], organization_type: params[:organization_type], focus_area: params[:focus_area], page: page, sort: sort) end begin diff --git a/app/models/concerns/indexable.rb b/app/models/concerns/indexable.rb index d6cbca044..1111e9897 100644 --- a/app/models/concerns/indexable.rb +++ b/app/models/concerns/indexable.rb @@ -161,9 +161,9 @@ 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: { 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? - must << { terms: { role_name: %w( ROLE_FOR_PROFIT_PROVIDER ROLE_CONTRACTUAL_PROVIDER ROLE_CONSORTIUM_LEAD ROLE_ALLOCATOR ROLE_MEMBER) }} must_not << { exists: { field: "deleted_at" }} unless options[:include_deleted] elsif self.name == "Client"