diff --git a/app/controllers/dois_controller.rb b/app/controllers/dois_controller.rb index 7ae79a30f..e4d0c8753 100644 --- a/app/controllers/dois_controller.rb +++ b/app/controllers/dois_controller.rb @@ -110,7 +110,7 @@ def index client_id: params[:client_id], prefix: params[:prefix], person_id: params[:person_id], - resource_type_id: camelize_str(params[:resource_type_id]), + resource_type_id: params[:resource_type_id], schema_version: params[:schema_version], source: params[:source], page: page, @@ -139,14 +139,14 @@ def index "total-pages" => total_pages, page: page[:number], states: states, - resource_types: resource_types, + "resource-types" => resource_types, years: years, created: created, registered: registered, providers: providers, clients: clients, prefixes: prefixes, - schema_versions: schema_versions, + "schema-versions" => schema_versions, sources: sources }.compact diff --git a/app/models/concerns/indexable.rb b/app/models/concerns/indexable.rb index 93c4b1458..26813b77f 100644 --- a/app/models/concerns/indexable.rb +++ b/app/models/concerns/indexable.rb @@ -114,7 +114,7 @@ def query(query, options={}) must = [] must << { multi_match: { query: query, fields: query_fields, type: "phrase_prefix", max_expansions: 50 }} if query.present? must << { term: { aasm_state: options[:state] }} if options[:state].present? - must << { term: { resource_type_general: options[:resource_type_id] }} if options[:resource_type_id].present? + must << { term: { resource_type_id: options[:resource_type_id] }} if options[:resource_type_id].present? must << { terms: { provider_id: options[:provider_id].split(",") }} if options[:provider_id].present? must << { terms: { client_id: options[:client_id].split(",") }} if options[:client_id].present? must << { term: { prefix: options[:prefix] }} if options[:prefix].present?