Skip to content

Commit

Permalink
data_type now index; content_status now sparse (#66)
Browse files Browse the repository at this point in the history
also added some comments
  • Loading branch information
ric-evans authored Feb 4, 2021
1 parent 1156480 commit 57196e3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion file_catalog/mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,29 @@ def __init__(self, host=None, port=None, authSource=None, username=None, passwor
authSource=authSource,
username=username, password=password).file_catalog

# all files
self.client.files.create_index('uuid', unique=True, background=True)
self.client.files.create_index('logical_name', unique=True, background=True)
self.client.files.create_index([('logical_name',pymongo.HASHED)], background=True)
self.client.files.create_index('locations', unique=True, background=True)
self.client.files.create_index([('locations.site',pymongo.DESCENDING),('locations.path',pymongo.DESCENDING)], background=True)
self.client.files.create_index('locations.archive', background=True)
self.client.files.create_index('create_date', background=True)
self.client.files.create_index('content_status', background=True)

# all .i3 files
self.client.files.create_index('content_status', sparse=True, background=True)
self.client.files.create_index('processing_level', sparse=True, background=True)
self.client.files.create_index('data_type', sparse=True, background=True)

# data_type=real files
self.client.files.create_index('run_number', sparse=True, background=True)
self.client.files.create_index('start_datetime', sparse=True, background=True)
self.client.files.create_index('end_datetime', sparse=True, background=True)
self.client.files.create_index('offline_processing_metadata.first_event', sparse=True, background=True)
self.client.files.create_index('offline_processing_metadata.last_event', sparse=True, background=True)
self.client.files.create_index('offline_processing_metadata.season', sparse=True, background=True)

# data_type=simulation files
self.client.files.create_index('iceprod.dataset', sparse=True, background=True)

self.client.collections.create_index('uuid', unique=True, background=True)
Expand Down

0 comments on commit 57196e3

Please # to comment.