Enhance Notice Repository with Additional Indexes
- Added new indexes for the notices collection in the notice repository to improve query performance. - Introduced indexes for `processing_metadata.processed` and `main_classification`, optimizing data retrieval and management.
This commit is contained in:
@@ -34,7 +34,11 @@ type noticeRepository struct {
|
||||
// NewRepository creates a new notice repository
|
||||
func NewRepository(mongoManager *orm.ConnectionManager, logger logger.Logger) Repository {
|
||||
// Create indexes for notices collection
|
||||
noticeIndexes := []orm.Index{}
|
||||
noticeIndexes := []orm.Index{
|
||||
// processing_metadata.processed
|
||||
*orm.NewIndex("processing_metadata_processed_idx", bson.D{{Key: "processing_metadata.processed", Value: 1}}),
|
||||
*orm.NewIndex("main_classification_idx", bson.D{{Key: "main_classification", Value: 1}}),
|
||||
}
|
||||
|
||||
// Create indexes
|
||||
if err := mongoManager.CreateIndexes(collectionName(), noticeIndexes); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user