Skip to content

Commit

Permalink
Merge pull request #6816 from ORCID/RemoveRinggoldFromSolrIndex
Browse files Browse the repository at this point in the history
Use REMOVED org status to remove RINGGOLD orgs from the index
  • Loading branch information
amontenegro authored Jun 19, 2023
2 parents b8d5dc0 + 6e1e18b commit 9f0e420
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void accept(OrgDisambiguatedSolrDocument t) {

private void process(OrgDisambiguatedSolrDocument t, Integer retryCount) {
try {
if("DEPRECATED".equals(t.getOrgDisambiguatedStatus()) || "OBSOLETE".equals(t.getOrgDisambiguatedStatus()) || "PART_OF_GROUP".equals(t.getOrgDisambiguatedStatus()) ) {
if("DEPRECATED".equals(t.getOrgDisambiguatedStatus()) || "OBSOLETE".equals(t.getOrgDisambiguatedStatus()) || "PART_OF_GROUP".equals(t.getOrgDisambiguatedStatus()) || "REMOVED".equals(t.getOrgDisambiguatedStatus())) {
solrUpdater.delete(String.valueOf(t.getOrgDisambiguatedId()));
} else {
solrUpdater.persist(t);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
*
*/
public enum OrganizationStatus {
DEPRECATED, OBSOLETE, PART_OF_GROUP;
DEPRECATED, OBSOLETE, PART_OF_GROUP, REMOVED;
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,8 @@ public List<OrgDisambiguatedEntity> findOrgsToGroup(int firstResult, int maxResu

@Override
public List<OrgDisambiguatedEntity> findOrgsPendingIndexing(int firstResult, int maxResult) {
TypedQuery<OrgDisambiguatedEntity> query = entityManager.createQuery("from OrgDisambiguatedEntity where indexingStatus != :indexingStatus",
TypedQuery<OrgDisambiguatedEntity> query = entityManager.createQuery("from OrgDisambiguatedEntity where indexingStatus not in ('DONE', 'IGNORE')",
OrgDisambiguatedEntity.class);
query.setParameter("indexingStatus", IndexingStatus.DONE);
query.setFirstResult(0);
query.setMaxResults(maxResult);
return query.getResultList();
Expand Down

0 comments on commit 9f0e420

Please sign in to comment.