Skip to content

Commit

Permalink
do not store closed elsevier abstract
Browse files Browse the repository at this point in the history
  • Loading branch information
caseydm committed Nov 8, 2024
1 parent 21e95e3 commit b85b3bc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions models/work.py
Original file line number Diff line number Diff line change
Expand Up @@ -2140,10 +2140,9 @@ def doi_url(self):
return "https://doi.org/{}".format(self.doi.lower())

@property
def is_closed_springer(self):
publisher_str = (
self.journal and self.journal.publisher) or self.publisher
if publisher_str and 'springer' in publisher_str.lower():
def is_closed_springer_or_elsevier(self):
publisher_str = (self.journal and self.journal.publisher) or self.publisher
if publisher_str and ('springer' in publisher_str.lower() or 'elsevier' in publisher_str.lower()):
return not self.is_oa
return False

Expand Down Expand Up @@ -2425,7 +2424,8 @@ def handle_indexing(self, index_suffix):
my_dict['authorships'] = my_dict.get('authorships', [])[0:100]
my_dict['authorships_truncated'] = True

if self.is_closed_springer:
if self.is_closed_springer_or_elsevier:
logger.info(f"not saving abstract for {self.paper_id} {self.doi}")
my_dict.pop('abstract', None)
my_dict["abstract_inverted_index"] = None

Expand Down Expand Up @@ -3008,7 +3008,7 @@ def to_dict(self, return_level="full"):
if return_level == "full":
response["abstract_inverted_index"] = self.abstract.to_dict(
"minimum") if self.abstract else None
if self.is_closed_springer:
if self.is_closed_springer_or_elsevier:
response["abstract_inverted_index"] = None

response["counts_by_year"] = self.display_counts_by_year
Expand Down

0 comments on commit b85b3bc

Please sign in to comment.