Skip to content

Commit

Permalink
index new client attributes for dois
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Jul 30, 2019
1 parent da465fb commit f88f672
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/models/concerns/indexable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ def query(query, options={})
must << { range: { registered: { gte: "#{options[:registered].split(",").min}||/y", lte: "#{options[:registered].split(",").max}||/y", format: "yyyy" }}} if options[:registered].present?
must << { term: { "client.re3data_id" => options[:re3data_id].upcase.gsub("/", '\/') }} if options[:re3data_id].present?
must << { term: { "client.opendoar_id" => options[:opendoar_id] }} if options[:opendoar_id].present?
must << { terms: { "client.certificate" => options[:certificate].split(",") }} if options[:certificate].present?
must_not << { terms: { provider_id: ["crossref", "medra", "op"] }} if options[:exclude_registration_agencies]
elsif self.name == "Event"
must << { term: { subj_id: options[:subj_id] }} if options[:subj_id].present?
Expand Down
5 changes: 5 additions & 0 deletions app/models/doi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,12 @@ class Doi < ActiveRecord::Base
opendoar_id: { type: :keyword },
prefix_ids: { type: :keyword },
name: { type: :text, fields: { keyword: { type: "keyword" }, raw: { type: "text", analyzer: "string_lowercase", "fielddata": true }} },
alternate_name: { type: :text, fields: { keyword: { type: "keyword" }, raw: { type: "text", analyzer: "string_lowercase", "fielddata": true }} },
description: { type: :text },
language: { type: :keyword },
client_type: { type: :keyword },
repository_type: { type: :keyword },
certificate: { type: :keyword },
contact_name: { type: :text },
contact_email: { type: :text, fields: { keyword: { type: "keyword" }} },
version: { type: :integer },
Expand Down

0 comments on commit f88f672

Please sign in to comment.