Skip to content

Commit

Permalink
fix(openalex): Restore excludedRors
Browse files Browse the repository at this point in the history
  • Loading branch information
annelhote committed Dec 12, 2024
1 parent b1d7dc0 commit dddf499
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/src/utils/works.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ const getFosmQuery = (options, pit, searchAfter) => {
},
});
}
if (options?.excludedRors?.length > 0) {
query.query.bool.must_not.push({ terms: { 'rors.keyword': options.excludedRors.split(' ') } });
}
return query;
};

Expand Down Expand Up @@ -357,6 +360,9 @@ const getOpenAlexPublicationsByYear = (options, cursor = '*', previousResponse =
if (options.openAlexExclusions.length) {
url += `,${options.openAlexExclusions.map((institutionId) => `authorships.institutions.lineage:!${institutionId}`).join()}`;
}
if (options?.excludedRors?.length) {
url += `,${options.excludedRors.split(' ').map((excludedRor) => `institutions.ror:!${excludedRor}`).join()}`;
}
// Polite mode https://docs.openalex.org/how-to-use-the-api/rate-limits-and-authentication#the-polite-pool
if (process?.env?.OPENALEX_KEY) {
url += `&api_key=${process.env.OPENALEX_KEY}`;
Expand Down

0 comments on commit dddf499

Please sign in to comment.