Skip to content

Commit

Permalink
Updating the citation_metadata query
Browse files Browse the repository at this point in the history
  • Loading branch information
rushirajnenuji committed Aug 13, 2019
1 parent a3cbbca commit 79e3ac8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/d1_metrics/d1_metrics/metricsdatabase.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def getCitations(self):

dois, pref = self.getDOIs()
csr = self.getCursor()
sql = "INSERT INTO CITATIONS_TEST(id, report, metadata, target_id, source_id, source_url, link_publication_date, origin, title, " + \
sql = "INSERT INTO CITATIONS(id, report, metadata, target_id, source_id, source_url, link_publication_date, origin, title, " + \
"publisher, journal, volume, page, year_of_publishing) values ( DEFAULT,'"

count = 0
Expand Down Expand Up @@ -530,7 +530,9 @@ def query_solr(self, q):
:return: JSON Object containing the metadata fields queried from Solr
"""

queryString = 'q=id:"' + q + '" OR seriesId:"' + q + '"&fl=origin,authoritativeMN,title,pubDate,datePublished,dateUploaded,topic,author&wt=json'
queryString = 'q=id:*' + q + '* OR id:*' + q.lower() + '* OR id:*' + q.upper() +
'* OR seriesId:*' + q + '* OR seriesId:*' + q.lower() +
'* OR seriesId:*' + q.upper() + '*&fl=origin,authoritativeMN&wt=json'

response = requests.get(url=self.solr_query_url, params=queryString)

Expand Down

0 comments on commit 79e3ac8

Please sign in to comment.