Skip to content

Commit

Permalink
support ranges in has_citations queries
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Feb 17, 2020
1 parent ac656a1 commit 792b23e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/models/doi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -693,9 +693,9 @@ def self.query(query, options={})
must << { term: { schema_version: "http://datacite.org/schema/kernel-#{options[:schema_version]}" }} if options[:schema_version].present?
must << { terms: { "subjects.subject": options[:subject].split(",") } } if options[:subject].present?
must << { term: { source: options[:source] } } if options[:source].present?
must << { range: { citation_count: { "gte": 1 } } } if options[:has_citations].present?
must << { range: { view_count: { "gte": 1 } } } if options[:has_views].present?
must << { range: { download_count: { "gte": 1 } } } if options[:has_downloads].present?
must << { range: { citation_count: { "gte": options[:has_citations].to_i } } } if options[:has_citations].present?
must << { range: { view_count: { "gte": options[:has_views].to_i } } } if options[:has_views].present?
must << { range: { download_count: { "gte": options[:has_downloads].to_i } } } if options[:has_downloads].present?
must << { term: { "landing_page.status": options[:link_check_status] } } if options[:link_check_status].present?
must << { exists: { field: "landing_page.checked" }} if options[:link_checked].present?
must << { term: { "landing_page.hasSchemaOrg": options[:link_check_has_schema_org] }} if options[:link_check_has_schema_org].present?
Expand Down

0 comments on commit 792b23e

Please sign in to comment.