Skip to content

Commit

Permalink
update query string to catch all variances of UNC and eliminate false…
Browse files Browse the repository at this point in the history
… positives
  • Loading branch information
davidcam-src committed Aug 15, 2024
1 parent 4b25287 commit a825df4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/services/tasks/dimensions_query_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,11 @@ def solr_query_builder(pub)
def generate_query_string(start_date, end_date, page_size, cursor)
search_clauses = ['where type = "article"', "date >= \"#{start_date}\"", "date < \"#{end_date}\""].join(' and ')
return_fields = ['basics', 'extras', 'abstract', 'issn', 'publisher', 'journal_title_raw', 'linkout', 'concepts'].join(' + ')
unc_affiliation_variants = ['"UNC-CH"', '"University of North Carolina at Chapel Hill"', '"UNC-Chapel Hill"', '"University of North Carolina-Chapel Hill"', '"University of North Carolina, Chapel Hill"'].join(' OR ')
<<~QUERY
search publications #{search_clauses} in raw_affiliations
for """
"University of North Carolina, Chapel Hill" OR "UNC"
#{unc_affiliation_variants}
"""
return publications[#{return_fields}]
limit #{page_size}
Expand Down

0 comments on commit a825df4

Please sign in to comment.