diff --git a/managers/sfrRecord.py b/managers/sfrRecord.py index d63f67556f..ca56fd5052 100644 --- a/managers/sfrRecord.py +++ b/managers/sfrRecord.py @@ -258,8 +258,10 @@ def parseInstance(self, workData, editionData, rec): editionData['dcdw_uuids'].append(rec.uuid.hex) def buildItems(self, editionData, rec, itemContributors): + max_part_number = max(int(item.split('|')[0]) for item in rec.has_part) + startPos = len(editionData['items']) - 1 - editionData['items'].extend([None] * len(rec.has_part)) + editionData['items'].extend([None] * max_part_number) for item in rec.has_part: no, uri, source, linkType, flags = tuple(item.split('|')) diff --git a/processes/cluster.py b/processes/cluster.py index a32ed8e6b4..d0c5e79ed3 100644 --- a/processes/cluster.py +++ b/processes/cluster.py @@ -28,9 +28,9 @@ def __init__(self, *args): self.createRedisClient() - self.createElasticConnection() - self.createElasticSearchIngestPipeline() - self.createElasticSearchIndex() + # self.createElasticConnection() + # self.createElasticSearchIngestPipeline() + # self.createElasticSearchIndex() def runProcess(self): try: @@ -55,6 +55,7 @@ def cluster_records(self, full=False, start_datetime=None): .filter(Record.cluster_status == False) .filter(Record.source != 'oclcClassify') .filter(Record.source != 'oclcCatalog') + .filter(Record.uuid == '2ddb63df-e4f5-479a-ad95-c03702c577b2') ) if not full: @@ -83,7 +84,7 @@ def cluster_records(self, full=False, start_datetime=None): raise e if len(works_to_index) >= self.CLUSTER_BATCH_SIZE: - self.update_elastic_search(works_to_index, work_ids_to_delete) + # self.update_elastic_search(works_to_index, work_ids_to_delete) logger.info(f'Clustered {len(works_to_index)} works') works_to_index = [] @@ -93,7 +94,7 @@ def cluster_records(self, full=False, start_datetime=None): self.session.commit() logger.info(f'Clustered {len(works_to_index)} works') - self.update_elastic_search(works_to_index, work_ids_to_delete) + # self.update_elastic_search(works_to_index, work_ids_to_delete) self.delete_stale_works(work_ids_to_delete) self.session.commit()